Skip to content

:head request stubbing always sets the Content-Length to 0 #50

@dup2

Description

@dup2

Describe the bug 🐛

When stubbing a :head request and trying to set a custom "Content-Length" via the headers, the value is always set to "0" in the result.

How to replicate it

WebMock.stub(:head, "http://127.0.0.1:9000/bucket-1/file-1?").
          to_return(headers: { "Content-Length" => "42" })

Expected

Doing the effective request should return headers with Content-Length set to 42

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions