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

Add compression middleware #18

Closed

Conversation

toshinari123
Copy link
Contributor

@kiootic
Copy link
Collaborator

kiootic commented Feb 5, 2024

Can you help add an Unwrap function to the compressed response writer, so that ResponseController can obtain the underlying writer?

ref: https://pkg.go.dev/net/http#NewResponseController

Copy link
Collaborator

@kiootic kiootic left a comment

Choose a reason for hiding this comment

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

The middleware is not applied, please add to the list of default middleware.

Copy link
Collaborator

@kiootic kiootic left a comment

Choose a reason for hiding this comment

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

Please try use this instead: https://github.com/go-chi/chi/blob/master/middleware/compress.go

Also, format the source code using go fmt.

Copy link
Collaborator

@kiootic kiootic left a comment

Choose a reason for hiding this comment

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

Please also test for the response body; it should be decompressed correctly to the original content.

@kiootic
Copy link
Collaborator

kiootic commented Feb 20, 2024

Merged via 39f6423.

@kiootic kiootic closed this Feb 20, 2024
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.

2 participants