Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: on 301 redirects, DELETE method is transformed into GET #21469
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
Hello @paravmellanox, thanks for the question.
So @bradfitz and I collaborated on fixing the redirect behavior at our weekend hackathons during the Go1.8 cycle in late September 2016, and I then implemented it with 7db996e, we used Google Doc https://docs.google.com/document/d/1LnWicNarwSdVWQ5RcgUOdHEGVcdR--Lravn6G0Hkg6c/edit?usp=sharing as the common scratch paper.
The rationale for 301/302/303 status converts converting all methods to GET is that we need to match what historically browsers have done (despite being arguably broken behavior); the 303 unconditionally redirects to GET and 301/302 do the same. Our reference was https://blogs.msdn.microsoft.com/ieinternals/2011/08/19/http-methods-and-redirect-status-codes/
We also documented this change in the release notes here https://golang.org/doc/go1.8#minor_library_changes
Hope this makes sense.