Skip to content
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

Response does not implement http.Hijacker #354

Closed
johnweldon opened this issue Sep 19, 2017 · 2 comments
Closed

Response does not implement http.Hijacker #354

johnweldon opened this issue Sep 19, 2017 · 2 comments

Comments

@johnweldon
Copy link
Contributor

The go-restful Response type does not implement http.Hijacker, and the underlying http.ResponseWriter loses the potential http.Hijacker implementation when it gets stored as an embedded interface, making it impossible to use a type assertion on the Response to get a Hijacker, even if the underlying ResponseWriter actually does implement Hijacker.

@johnweldon
Copy link
Contributor Author

Incidentally related to #338

This feature is needed to allow the gorilla websocket implementation to work with go-restful.

@emicklei
Copy link
Owner

thank you for contributing

kujenga added a commit to kujenga/go-stdlib that referenced this issue Jul 16, 2018
This is needed in order for users of this package to implement websocket
support, as without it, the statusCodeTracker struct does not implement
the correct interface because it knows nothing about the underlying
implementation of it's embedded http.ResponseWriter.

For reference, many other project have had this same issue, here's a
list of some found in a quick search for the issue, I'm sure there are
others as well:
- golang/go#14797
- census-instrumentation/opencensus-go#642
- go-chi/chi#131
- nytimes/gziphandler#26
- caddyserver/caddy#133
- emicklei/go-restful#354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants