This commit is contained in:
Salman Muin Kayser Chishti
2025-08-06 12:57:10 +01:00
parent 8c3fc9ed99
commit bcb928642f
+14 -6
View File
@@ -275,7 +275,8 @@ export class HttpClient {
Headers.Accept,
MediaTypes.ApplicationJson
)
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(
additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders,
MediaTypes.ApplicationJson
)
@@ -298,7 +299,8 @@ export class HttpClient {
Headers.Accept,
MediaTypes.ApplicationJson
)
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(
additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders,
MediaTypes.ApplicationJson
)
@@ -321,7 +323,8 @@ export class HttpClient {
Headers.Accept,
MediaTypes.ApplicationJson
)
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(
additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders,
MediaTypes.ApplicationJson
)
@@ -634,14 +637,17 @@ export class HttpClient {
if (this.requestOptions && this.requestOptions.headers) {
const headerValue = lowercaseKeys(this.requestOptions.headers)[header]
if (headerValue) {
clientHeader = typeof headerValue === 'number' ? headerValue.toString() : headerValue
clientHeader =
typeof headerValue === 'number' ? headerValue.toString() : headerValue
}
}
const additionalValue = additionalHeaders[header]
if (additionalValue !== undefined) {
return typeof additionalValue === 'number' ? additionalValue.toString() : additionalValue
return typeof additionalValue === 'number'
? additionalValue.toString()
: additionalValue
}
if (clientHeader !== undefined) {
@@ -657,7 +663,9 @@ export class HttpClient {
): string {
let clientHeader: string | undefined
if (this.requestOptions && this.requestOptions.headers) {
const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType]
const headerValue = lowercaseKeys(this.requestOptions.headers)[
Headers.ContentType
]
if (headerValue) {
if (typeof headerValue === 'number') {
clientHeader = String(headerValue)