You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue implies Go v1.4.2 on darwin/amd64 architecture.
Currently, http.NotFoundHandler, that replies to all 404 requests has the following implementation:
// NotFound replies to the request with an HTTP 404 not found error.funcNotFound(wResponseWriter, r*Request) { Error(w, "404 page not found", StatusNotFound) }
// NotFoundHandler returns a simple request handler// that replies to each request with a ``404 page not found'' reply.funcNotFoundHandler() Handler { returnHandlerFunc(NotFound) }
// ^^^^^^^^^^^^^^^
This works pretty great for a helloworld application, but in the wild you would need to override default 404 page with a custom one. In the meantime, implementing your own 404 handler is not an issue at all, unless it's being called by FileServer() or ServeFile, which people are using to serve some static.
In my opinion, http.NotFoundHandler is not flexible enough and we must have a way to override it with custom 404 error handler.
The text was updated successfully, but these errors were encountered:
This has come up a number of times before on the issue tracker and mailing lists. You can implement your own ResponseWriter which writes a custom message after WriteHeader.
The net/http package will not be growing a pluggable template system.
This issue implies Go v1.4.2 on darwin/amd64 architecture.
Currently, http.NotFoundHandler, that replies to all 404 requests has the following implementation:
This works pretty great for a helloworld application, but in the wild you would need to override default 404 page with a custom one. In the meantime, implementing your own 404 handler is not an issue at all, unless it's being called by
FileServer()
orServeFile
, which people are using to serve some static.In my opinion,
http.NotFoundHandler
is not flexible enough and we must have a way to override it with custom 404 error handler.The text was updated successfully, but these errors were encountered: