vapor/vapor

Response compression handler not added for HTTP2 requests

dimitribouniol opened this issue · 0 comments

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