FAQ
Given that our Director function can't return an error indicating that it
won't handle the request, I notice that we can instead panic it and then
*http.conn.serve() will recover and close the connection with the client.
Aside from forgoing a descriptive HTTP response, is this a bad solution?
On Sunday, 12 August 2012 02:45:17 UTC+1, Andrew Gerrand wrote:

Unfortunately such a change would break compatibility with Go 1 programs.

You have a couple of options:

1a. Implement a custom http.RoundTripper that checks for a specific
header in the request and sends an HTTP error if it is present.
1b. Have your Director function set that specific header when no rute is
found.

2. Make a copy of the reverseproxy code, make your changes to it, and use
that.

Andrew
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 13, '13 at 4:39p
activeMay 13, '13 at 4:39p
posts1
users1
websitegolang.org

1 user in discussion

Frou: 1 post

People

Translate

site design / logo © 2023 Grokbase