Skip to content

incorrectly sent "Content-Length": "" #2363

Open
@Lodimup

Description

@Lodimup

openapi-fetch version

0.14.0

Description

openapi fetch is sending incorrect "Content-Length": "" with empty string, the correct one should be "Content-Length": "123"

  const { data, error } =
    await await.POST(
      "/",
      {
        body: body,
        headers: {
          "Content-Length": JSON.stringify(body
          ).length,
        },
      },
    );

above snippet resolves the issue by manually inputting the content length

Reproduction

  const { data, error } =
    await await.POST(
      "/",
      {
        body: body,
      },
    );

Expected result

content-length header is non empty

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions