dmitri.shuralyov.com/app/changes/...

Don't set Content-Type for httperror.Redirect.

Remove workaround for https://groups.google.com/forum/#!topic/golang-nuts/9AVyMP9C8Ac
since it has been fixed upstream in Go 1.10.
dmitshur committed 6 years ago commit aa34492299b960e1480be2ac5d819dd6edaa8396
Collapse all
errorhandler.go
@@ -36,13 +36,10 @@ func (h *errorHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
	if err, ok := httperror.IsMethod(err); ok {
		httperror.HandleMethod(w, err)
		return
	}
	if err, ok := httperror.IsRedirect(err); ok {
		if req.Method == http.MethodGet { // Workaround for https://groups.google.com/forum/#!topic/golang-nuts/9AVyMP9C8Ac.
			w.Header().Set("Content-Type", "text/html; charset=utf-8")
		}
		http.Redirect(w, req, err.URL, http.StatusSeeOther)
		return
	}
	if err, ok := httperror.IsBadRequest(err); ok {
		httperror.HandleBadRequest(w, err)