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
# curl can send it
http://localhost/pizza -X POST -H "Transfer-Encoding: chunked" -d 'foo=bar&baz=grault' -vv
# the server doesn't show it
/
/
POST
User-Agent [curl/7.37.1]
Accept [*/*]
Content-Type [application/x-www-form-urlencoded]
&{0xc20807c300 0xc208032340 0xc20805c240 false {0 0} false}
# yet other headers show up as expected
http://localhost/pizza -X POST -H "X-Transfer-Encoding: chunked" -d 'foo=bar&baz=grault' -vv
# server shows this
/
/
POST
X-Transfer-Encoding [chunked]
Content-Length [18]
Content-Type [application/x-www-form-urlencoded]
User-Agent [curl/7.37.1]
Accept [*/*]
&{0xc2080aa700 <nil><nil>false {0 0} false}
The text was updated successfully, but these errors were encountered:
bradfitz
changed the title
Server's http.Request strips Transfer-Encoding header
net/http: Server's http.Request strips Transfer-Encoding header
Jul 14, 2015
Go does this intentionally: it handles decoding the transfer-encoding, so by the time the body arrives at ServeHTTP the handler should not care at all. I believe this is working as intended.
Do you need the Transfer-Encoding for some reason?
Probably a low-priority issue. Not a big deal, just a little confusing.
Also, I'm well-aware that browsers don't send with
Transfer-Encoding: chunked
, but there are clients that can.Perhaps this is intentional, but if so, I didn't see it in the documentation.
Here's a little demo code
The text was updated successfully, but these errors were encountered: