API returns incorrect Content-Length for elements that have 'gone' #537
Comments
Author: tom[at]compton.nu The code just does: render :nothing => true, :status => :gone so this must be a rails or lighttpd problem I think. |
Author: jburgess[at]uklinux.net This appears to be a documented feature of rails, but fairly easy to workaround:- "Rendering nothing Rendering nothing is often convenient in combination with Ajax calls that perform their effect client-side or when you just want to communicate a status code. Due to a bug in Safari, nothing actually means a single space."
According to http://dev.rubyonrails.org/ticket/9481 this workaround even breaks Safari in other circumstances. The attached patch makes the deleted ways return content-length:0 |
Author: tom[at]compton.nu This doesn't make any sense though - the content length may be getting set to one, but it is also returning a space. Where is that space going? Something must be eating it... |
Author: jburgess[at]uklinux.net At least it explains the conten-length=1 and the workaround fixes it. Since you really seem to be desperate to find what happens to the missing space, I'll try to find out. I suspect it could be related to Richards Actionscript problem where the final character was being deleted (I think this was yet another broken 'fix' done for Safari). |
Author: tom[at]compton.nu I'm working on it right now - currently lighttpd is in the frame as I have an strace showing the space being included in the FCGI response from rails to lighttpd but not in the HTTP response from lighttpd to the client. |
Author: tom[at]compton.nu This is down to lighttpd - see http://trac.lighttpd.net/trac/ticket/1055 which appears to cover it. |
Author: tomhughes (In [5058]) Render an empty text string instead of nothing (which actually generate a |
Reporter: rollercow[at]sucs.org
[Submitted to the original trac issue database at 4.44pm, Thursday, 13th September 2007]
API returns incorrect Content-Length for elements that have 'gone'
For example
If you request http://www.openstreetmap.org/api/0.4/way/4627408
The server returns
Content-Length: 1
Yet no content is returned, so it should return
Content-Length: 0
(or some content)
The text was updated successfully, but these errors were encountered: