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

Flush() being called for ResponseWriter which doesn't implement the interface #480

Closed
mangas opened this issue Jun 13, 2019 · 2 comments · Fixed by #479 or #817
Closed

Flush() being called for ResponseWriter which doesn't implement the interface #480

mangas opened this issue Jun 13, 2019 · 2 comments · Fixed by #479 or #817
Labels

Comments

@mangas
Copy link
Contributor

mangas commented Jun 13, 2019

Versions of relevant software used
v0.9.6

What happened
Panic when cast to interface

What you expected to happen
Method should only be called upon successful cast

How to reproduce it (as minimally and precisely as possible):
Call webGrpcResponse.Flush() with wrapped being an instance of http.ResponseWriter

@johanbrandhorst
Copy link
Contributor

I left a comment on #479 already, but basically; why do you need this? I don't think it's as clear cut as just doing it opportunistically. Is there any option for you to implement Flush on your ResponseWriter instead?

@mangas
Copy link
Contributor Author

mangas commented Jun 13, 2019

There are 2 reason why I think this should be solved in the wrapper.

  1. The api semantics don't specify anything regarding the ResponseWriter having to implement http.Flusherand should in that case treat as an optional feature or change the api to take a Flusher instance.

  2. Implementing a "dummy" Flush func also means flush might be called assuming the normal semantics and in fact nothing will happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants