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
Right now there are a couple of issues when using net/http as a transparent proxy
- There's no way to write trailer headers.
- There's no way to provide a custom status text, E.g. "420 Enhance Your Calm"
- Content-Type header is added on every response.
Being able to give the ResponseWriter a *Response gets around all of these problems.
Something like
type Responder interface {
Respond(*Response) error
}
in net/http would make it possible to use the server as a transparent proxy.
The text was updated successfully, but these errors were encountered:
Trailer Headers is issue #7759. There's nothing special about proxies here, other than
that once issue #7759 is fixed, httputil.ReverseProxy should perhaps use it.
Custom Status Text is marginally useful and marginally harmful: it shouldn't matter.
Correct implementations should not be reading like humans. "The Reason-Phrase is
intended to give a short textual description of the Status-Code. The Status-Code is
intended for use by automata and the Reason-Phrase is intended for the human user. The
client is not required to examine or display the Reason- Phrase." Until I'm hear a
really great reason, I'd prefer to not clutter up net/http.
Please file a separate bug just about omitting Content-Type in responses.
I won't be adding something so large of an interface as Responder, though. It overlaps
too much with other stuff and would be confusing, and hard to support over time.
The text was updated successfully, but these errors were encountered: