-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Don't panic if ResponseWriter does not implement CloseNotify #2651
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @juliens !!
Only one little note about a comment, otherwise SGTM.
middlewares/retry.go
Outdated
GetBody() *bytes.Buffer | ||
IsStreamingResponseStarted() bool | ||
} | ||
|
||
// retryResponseRecorder is an implementation of http.ResponseWriter that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be changed into retryResponseRecorderWithoutCloseNotify
or moved above?
f6009c4
to
833745a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
37adb8f
to
5e4ecbf
Compare
i still see this in 1.5.0 final
if i disable http compression it is fine. |
What does this PR do?
Fix a panic in the retry middleware if the responseWriter does not implement CloseNotify. Happen with compress=true (Gzip does not implement CloseNotify yet)
Motivation
Fixes #2628
More
I think this is better that the next handler choose what to do if we don't implement CloseNotify instead of Panic or implement a wrong version of CloseNotify.