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

middleware.Compress: implement Unwrap() method to the compressResponseWriter #819

Merged
merged 1 commit into from
May 2, 2023

Conversation

kei2100
Copy link
Contributor

@kei2100 kei2100 commented Apr 27, 2023

This PR solves #818

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kei2100
Copy link
Contributor Author

kei2100 commented May 2, 2023

@VojtechVitek
Thank you for the approval!

@pkieltyka
Please let me know if there is any work I should do for the merge.

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -382,6 +382,10 @@ func (cw *compressResponseWriter) Close() error {
return errors.New("chi/middleware: io.WriteCloser is unavailable on the writer")
}

func (cw *compressResponseWriter) Unwrap() http.ResponseWriter {
return cw.ResponseWriter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same pattern as in

func (b *basicWriter) Unwrap() http.ResponseWriter {
.

Going to merge.

@VojtechVitek VojtechVitek merged commit 8cbdac6 into go-chi:master May 2, 2023
12 checks passed
@kei2100 kei2100 deleted the compress-respwriter-unwrap branch May 2, 2023 10:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants