Nginx would really like a Content-Length of 0 for any DELETE requests. I'm currently adding the header in ServicesClientConnection::delete(), patch attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpstrikesback’s picture

Title: Nginx DELETE request returns 411 Length Required. Content-Length = 0 required. » DELETE request to Nginx returns 411 Length Required. Content-Length = 0 required.
jpstrikesback’s picture

Status: Active » Needs review
mhrabovcin’s picture

Status: Needs review » Needs work

I'd like to see this as part of REST plugin rather than services client class because this doesn't need to necessary apply on XML-RPC server or other servers.

jpstrikesback’s picture

jpstrikesback’s picture

Status: Needs work » Needs review
mhrabovcin’s picture

What about adding general Content-Length support to Rest plugin?

jpstrikesback’s picture

I like that, I'll test that and get back here

mhrabovcin’s picture

Did you tested if fix was working correctly?

jpstrikesback’s picture

I just tested it and there are a few items:

- $this->data should be $request->data
- $request->data is at least sometimes an empty array (so strlen() breaks things as it throws a warning) (i.e. when doing a DELETE)

The only real issue is the array, which may be only set on DELETE? I don't know offhand.

jpstrikesback’s picture

Status: Needs review » Needs work