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
Description
In the generated
@hey-api/client-angularclient, the following snippet will remove the'Content-Type'header, but does not reassign theHttpHeaderstoopts.headers. Angular's HttpHeaders are immutable and.delete()returns a copy with the header removed.openapi-ts/packages/openapi-ts/src/plugins/@hey-api/client-angular/bundle/client.ts
Lines 83 to 86 in 82e9f18
Reproducible example or configuration
No response
OpenAPI specification (optional)
No response
System information (optional)
No response