@@ -39,12 +39,12 @@ func TestParsePrefixedTitle(t *testing.T) { }, } for _, tc := range tests { gotPaths, gotTitle := gido.ParsePrefixedTitle(tc.in) if !reflect.DeepEqual(gotPaths, tc.wantPaths) { t.Errorf("got: %q, want: %q", gotPaths, tc.wantPaths) t.Errorf("got paths: %q, want: %q", gotPaths, tc.wantPaths) } if gotTitle != tc.wantTitle { t.Errorf("got: %q, want: %q", gotTitle, tc.wantTitle) t.Errorf("got title: %q, want: %q", gotTitle, tc.wantTitle) } } }
@@ -37,13 +37,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)