feross / simple-get

Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines
MIT License
401 stars 50 forks source link

rewrite redirected POST request to a GET #35

Closed finnp closed 6 years ago

finnp commented 7 years ago

Browsers rewrite 301 and 301 redirects for POST requests to GET. This is also specified in https://tools.ietf.org/html/rfc7231\#section-6.4.2 now.

Our current implementation forgets to pass the body to the redirect on POST anyway. So it will hang, since it's only passing the content-length, but not the body.

I suggest to implement the browser's behavior as this is what most people would expect.

feross commented 6 years ago

Sorry for the delay on merging this. Just catching up on things now :)

feross commented 6 years ago

2.8.0