-
Dmitri Shuralyov authored
In CL 50510, the Content-Type header started to be set in Redirect when request method is GET. (Prior to that, it wasn't set at all, which is what said CL was fixing.) However, according to HTTP specification, the expected response for a HEAD request is identical to that of a GET request, but without the response body. This CL updates the behavior to set the Content-Type header for HEAD method in addition to GET. This actually allows a simpler implementation than before. This change largely reverts CL 50510, and applies the simpler implementation. Add a test for Content-Type header and body for GET, HEAD requests. Updates CL 50510. Change-Id: If33ea3f4bbc5246bb5dc751458004828cfe681b9 Reviewed-on: https://go-review.googlesource.com/65190 Run-TryBot: Dmitri Shuralyov <shurcool@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Tom Bergan <tombergan@google.com>
2ff75551