You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clients hang waiting for some indication that content is done, as in:
> curl -v http://localhost:4000/
# ...
< HTTP/1.1 301 Moved Permanently
< date: Wed, 02 Nov 2022 14:46:38 GMT
< cache-control: max-age=0, private, must-revalidate
< x-request-id: FyPL1BNQtEYMFM4AAQsD
< location: http://example.org/
* no chunk, no close, no size. Assume close to signal end
I figured it out that cowboy adds a content-length: 0 header making curl and other clients happy.
I fixed in my app by doing the same with a put_resp_header call. My question is: who should handle that case? Is my plug required to provide the content-length?
The text was updated successfully, but these errors were encountered:
As it turns out Bandit wasn't strict enough in its HTTP/1.x content-length return value logic. This is fixed on main at d25735b and will be tagged for release as 0.5.8 as soon as CI passes.
Hello,
I was testing porting an app from cowboy2 to bandit and found a behaviour I am not sure on where it should be fixed.
My app is using
Plug.Router
(no phoenix) and one of the endpoints makes a 301 redirect, with a location header and an empty body.A simple simulation of that can be:
Clients hang waiting for some indication that content is done, as in:
I figured it out that cowboy adds a
content-length: 0
header making curl and other clients happy.I fixed in my app by doing the same with a
put_resp_header
call. My question is: who should handle that case? Is my plug required to provide the content-length?The text was updated successfully, but these errors were encountered: