Opened 15 years ago
Closed 15 years ago
#10783 closed task (blessed) (fixed)
WordPress's GET function is sending a content-length of 0
Reported by: | noel | Owned by: | DD32 |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.4 |
Component: | HTTP API | Keywords: | press this, http |
Focuses: | Cc: |
Description
Sending a content length of 0 with the GET request makes the request fail on some servers.
Sending a blank response of null or false works fine.
The included patch works well (and is necessary for Press This to function correctly under certain instances).
Attachments (2)
Change History (8)
#1
@
15 years ago
- Milestone changed from Unassigned to 2.9
- Resolution set to fixed
- Status changed from new to closed
#2
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
A null value basically just removes that value from the array and doing so defeats the entire purpose of why it was put there in the first place.
The correct solution will be to test for POST if there isn't a body and set it. If there is a body, then set it.
The reason it was put there was become some servers require it to be there. So while it works for yours, it will not work for another server. A compromise or filter has to be made in order to ensure that it continues to work or allow for it to be made to work based on configurations.
#3
follow-up:
↓ 4
@
15 years ago
This only affects GET requests, perhaps the workaround is to always send something to the server when doing a GET, like a single white space, etc. Then Content-Length will be 1.
#4
in reply to:
↑ 3
@
15 years ago
Meant to say "always send something to the server when doing a POST" above.
Related bug in PEAR http://pear.php.net/bugs/bug.php?id=14740 was fixed by setting Content-Length only for POST and PUT requests.
http.php patch