aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitri@shuralyov.com>2018-05-04 13:05:15 -0400
committerDmitri Shuralyov <dmitri@shuralyov.com>2018-05-04 18:01:10 +0000
commit73e38303f3e24ea651778705606b390d088070f0 (patch)
treef9b632807d1c7a5888a839b07e3193f11a247f08 /src/database/sql
parent3b137dd2df19c261a007b8a620a2182cd679d700 (diff)
downloadgo-73e38303f3e24ea651778705606b390d088070f0.tar.xz
net/http: write status code in Redirect when Content-Type header set
This is a followup to CL 110296. That change added a new behavior to Redirect, where the short HTML body is not written if the Content-Type header is already set. It was implemented by doing an early return. That unintentionally prevented the correct status code from being written, so it would always default to 200. Existing tests didn't catch this because they don't check status code. This change fixes that issue by removing the early return and moving the code to write a short HTML body behind an if statement. It adds written status code checks to Redirect tests. It also tries to improve the documentation wording and code style in TestRedirect_contentTypeAndBody. Updates #25166. Change-Id: Idce004baa88e278d098661c03c9523426c5eb898 Reviewed-on: https://go-review.googlesource.com/111517 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/database/sql')
0 files changed, 0 insertions, 0 deletions