(Combined)LoggingHandler: Add Go 1.8 http.Pusher support#97
Merged
kisielk merged 2 commits intogorilla:masterfrom Feb 9, 2017
Merged
(Combined)LoggingHandler: Add Go 1.8 http.Pusher support#97kisielk merged 2 commits intogorilla:masterfrom
kisielk merged 2 commits intogorilla:masterfrom
Conversation
When building with Go 1.8, embed http.Pusher interface in loggingResponseWriter interface and define a Push wrapper method on responseLogger. Without this change, users of handlers.LoggingHandler or handlers.CombinedLoggingHandler cannot take advantage of the new http.Pusher interface since responseLogger does not satisfy the http.Pusher interface. When building with pre-1.8 Go, the loggingResponseWriter and responseLogger types remain unchanged.
Contributor
|
Can you add a test for this? |
Added two tests TestLoggingHandlerWithPush and TestCombinedLoggingHandlerWithPush in new handlers_go18_test.go file which is only built with Go 1.8 or higher. Tests ensure that the ResponseWriter passed to a handler wrapped with handlers.LoggingHandler or handlers.CombinedLoggingHandler satisfy the new http.Pusher interface.
Author
|
I added a couple tests, let me know if you need anything more in depth. |
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building with Go 1.8, embed http.Pusher interface in
loggingResponseWriter interface and define a Push wrapper method on
responseLogger. Without this change, users of handlers.LoggingHandler
or handlers.CombinedLoggingHandler cannot take advantage of the new
http.Pusher interface.
When building with pre-1.8 Go, the loggingResponseWriter and
responseLogger types remain unchanged.