fix: infer media-type for falsy bodies except 'undefined'

This commit is contained in:
Finn Poppinga 2024-03-13 17:25:03 +01:00 committed by GitHub
parent 9e475d9668
commit 06fc90916f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): O
headers['Authorization'] = `Basic ${credentials}`;
}
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType) {
headers['Content-Type'] = options.mediaType;
} else if (isBlob(options.body)) {

View File

@ -29,7 +29,7 @@ export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptio
headers['Authorization'] = `Basic ${credentials}`;
}
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType) {
headers['Content-Type'] = options.mediaType;
} else if (isBlob(options.body)) {

View File

@ -26,7 +26,7 @@ export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptio
headers['Authorization'] = `Basic ${credentials}`;
}
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType) {
headers['Content-Type'] = options.mediaType;
} else if (isBlob(options.body)) {

View File

@ -26,7 +26,7 @@ export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptio
headers['Authorization'] = `Basic ${credentials}`;
}
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType) {
headers['Content-Type'] = options.mediaType;
} else if (isBlob(options.body)) {

View File

@ -26,7 +26,7 @@ export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptio
headers['Authorization'] = `Basic ${credentials}`;
}
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType) {
headers['Content-Type'] = options.mediaType;
} else if (isBlob(options.body)) {