webmachine-ruby
webmachine-ruby copied to clipboard
Create an error response body outside render_error (issue #144)
In l7 the resource and encodings_provided? is available so encode_body can be used. In this case the standard error response would have to be created outside of render_error though.
This works for gzip but not for deflate...
I think the better solution would be to have render_error
properly set the headers. If that means clearing the selected encoding, that would be preferable to reporting the content-length
incorrectly.
I guess I did not understand that correctly.
So the Content-Encoding header should be cleared because the Content-Length header can't be changed there. Even if encodings_provided is set, in case of a 404 Content-Encoding should be clear.
@jimvm I was merely suggesting the most expedient solution, not a hard-and-fast one. Basically, regardless of what the response returns, the content-length
needs to take into account the content-encoding
, or we're in a lot of trouble.