Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Return status code 404 on 404 page

The NotFoundHandler previously returned status code 200
because WriteHeader wasn't called.
Cette révision appartient à :
Atvaark 2017-05-07 16:17:23 +02:00
Parent 4814fff3dc
révision 87fec6c5ab

Voir le fichier

@ -15,6 +15,8 @@ func init() {
}
func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
searchForm := NewSearchForm()
searchForm.HideAdvancedSearch = true
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, searchForm, r.URL, mux.CurrentRoute(r)})