Skip to content

Angular Client Content-Type header not stripped on bodyless requests #3987

@joshkaplinsky

Description

@joshkaplinsky

Description

In the generated @hey-api/client-angular client, the following snippet will remove the 'Content-Type' header, but does not reassign the HttpHeaders to opts.headers. Angular's HttpHeaders are immutable and .delete() returns a copy with the header removed.

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.body === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
}

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Broken or incorrect behavior.

    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