Skip to content

Auto-deflate injects Content-Encoding even wihtout body #521

Description

@ixti

Example:

require "http"
require "logger"

HTTP.use(:logging => { :logger => Logger.new(STDOUT) })
  .use(:auto_deflate)
  .get("https://example.com")

The above will send request:

GET https://example.com/
Connection: close
Content-Encoding: gzip
Host: example.com
User-Agent: http.rb/4.0.3

Content-Encoding is being sent as gzip, while there's no content at all. That makes some servers go nuts. E.g. I've seen 403 responses, while example.com responds with 400 (which I believe is correct response if it needs to be failed)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions