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

Response compression handler not added for HTTP2 requests #3125

Closed
dimitribouniol opened this issue Jan 3, 2024 · 0 comments · Fixed by #3126
Closed

Response compression handler not added for HTTP2 requests #3125

dimitribouniol opened this issue Jan 3, 2024 · 0 comments · Fixed by #3126
Labels
bug Something isn't working

Comments

@dimitribouniol
Copy link
Contributor

dimitribouniol commented Jan 3, 2024

Describe the bug

I noticed the response compression didn't work for HTTP2 requests, because the addVaporHTTP2Handlers() method doesn't seem to add the handlers like the HTTP1 handler does.

To Reproduce

  1. Configure an app with TLS and the following lines:
    app.http.server.configuration.responseCompression = .enabled
    app.http.server.configuration.supportVersions = [.one, .two]
  1. Access the route via Safari
  2. Notice requests aren't compressed. Removing the supportedVersions line (and thus HTTP2) enables compression as expected.

HTTP1.1:
image

HTTP2:
image

Expected behavior

Responses should be compressed when accessed over typical browsers.

Environment

  • Vapor Framework version: 4.87.1
  • Vapor Toolbox version: 18.7.4
  • OS version: macOS 14.1.2
@dimitribouniol dimitribouniol added the bug Something isn't working label Jan 3, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 3, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 3, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 7, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 7, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 23, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 24, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Jan 30, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Feb 11, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Feb 14, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Feb 21, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Mar 23, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Apr 15, 2024
dimitribouniol added a commit to dimitribouniol/vapor that referenced this issue Apr 19, 2024
0xTim pushed a commit that referenced this issue Apr 19, 2024
* Fixed an issue where HTTP2 didn't support response compression and request recompression

Fixes #3125

* Added exhaustive tests for request and response compression across both HTTP 1.1 and HTTP 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant