Skip to content

Logger outputs canonicalised request headers, rather than logging what is sent #600

@unikitty37

Description

@unikitty37
logger = Logger.new(STDERR)
http_headers = {
  'TEST_ONE' => 1,
  'TEST.TWO' => 2
}
HTTP.headers(http_headers)
    .use(logging: {logger: logger})
    .use(:auto_inflate).headers('Accept-Encoding' => 'gzip')
    .post('https://example.com')

produces this:

I, [2020-03-12T15:51:28.560383 #1]  INFO -- : > POST https://example.com
D, [2020-03-12T15:51:28.560482 #1] DEBUG -- : Test-One: 1
Test.two: 2
Accept-Encoding: gzip
Connection: close
Host: example.com
User-Agent: http.rb/4.3.0

While #576 means the header should be sent as specified in http_headers, it's difficult to confirm this from the logger output! Could the logger output the unaltered header instead, please?

(It would also be useful if it could output a newline before that first header — it tends to get lost in the noise of the timestamp line 🙂)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions