Skip to content

Breaking change in nock@14.0.14 - content length is not set automatically #2972

@anthony-telljohann

Description

@anthony-telljohann

Please avoid duplicates

Reproducible test case

tbd

Nock Version

nock@14.0.14

Node Version

v24.14.0

TypeScript Version

No response

What happened?

Previously, with nock version 14.0.13 and lower, the content-length header was automatically set. However, now with nock version 14.0.14, content-length header is not automatically set which is causing my http request library got to throw an error.

I was able to fix this by adding a call to scope.replyContentLength() in my test setup. But I wanted to raise awareness of the behavior change in case it was unintentional.

Would you be interested in contributing a fix?

  • yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions