Merge pull request #2066 from fpoppinga/fix-falsy-headers

fix: infer media-type for falsy bodies except 'undefined'
This commit is contained in:
Ferdi Koomen 2024-03-17 20:44:07 +01:00 committed by GitHub
commit 7ac99d4094
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)) {