-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http/httputil: add a custom-error-page ResponseWriter wrapper type #15034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Probably a dup of #10123 or one of the previous issues discussing this. A big external library is not required. One way you can handle this is by providing your own ResponseWriter which spits out your custom page after it sees |
I was just quoting several people who have tried to solve this issue in a clean way in the built-in dev file server in Hugo. I haven't looked into this my self, but if the "common Go developer" are having a hard time cracking this nut, you should consider to help him/her. |
A quick and dirty proof-of-concept. |
Sure, but this is still 50ish lines of code that every person (I know, not every ...) who wants to use the |
It would be nice if we could handle things other than status code, for example timeouts. In the meantime we're using https://github.com/vulcand/oxy , which provides error handling in its reverse proxy. |
Dup of #10123. |
Please answer these questions before submitting your issue. Thanks!
go version
)?Not relevant.
go env
)?Not relevant.
Try to present a nice 404.html to the end user on Page Not Found when using the Go builtin file server.
This should be a common enough use case that I shouldn't have to drag big external libraries in to solve this.
That I had to drag in big external libraries to solve this.
See gohugoio/hugo#874
The text was updated successfully, but these errors were encountered: