Opened 9 years ago

Closed 9 years ago

#3010 closed defect (invalid)

Rails Port returns bad Content-Length header on error.

Reported by: woodpeck Owned by: Tom Hughes
Priority: minor Milestone:
Component: api Version:
Keywords: Cc: frederik@…


In some error cases the Content-Length header does not match the actual payload returned in the HTTP message. Example:

$ wget -SObroken ',-80,100,80' HTTP/1.0 400 Bad Request Content-Type: text/html Error: The maximum bbox size is 0.25, and your request was too large. Either request a smaller area, or use planet.osm Content-Length: 184 Connection: keep-alive Date: Wed, 26 May 2010 16:38:12 GMT Server: lighttpd/1.4.22

$ wc -l broken 0

In this case, 0 bytes of payload were transmitted but the server said that it was sending 184 bytes. This can possibly create problems with clients that keep the connection open - they might wait forever for the 184 bytes to appear.

Change History (1)

comment:1 Changed 9 years ago by Tom Hughes

Resolution: invalid
Status: newclosed

I think this is wget being silly. I see the same thing, but wireshark shows that the data is there so wget is apparently discarding it. Doing the same thing with curl does give you the body back.

Note: See TracTickets for help on using tickets.