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, Headers.Accept,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader( additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders, additionalHeaders,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
@@ -298,7 +299,8 @@ export class HttpClient {
Headers.Accept, Headers.Accept,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader( additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders, additionalHeaders,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
@@ -321,7 +323,8 @@ export class HttpClient {
Headers.Accept, Headers.Accept,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader( additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(
additionalHeaders, additionalHeaders,
MediaTypes.ApplicationJson MediaTypes.ApplicationJson
) )
@@ -634,14 +637,17 @@ export class HttpClient {
if (this.requestOptions && this.requestOptions.headers) { if (this.requestOptions && this.requestOptions.headers) {
const headerValue = lowercaseKeys(this.requestOptions.headers)[header] const headerValue = lowercaseKeys(this.requestOptions.headers)[header]
if (headerValue) { if (headerValue) {
clientHeader = typeof headerValue === 'number' ? headerValue.toString() : headerValue clientHeader =
typeof headerValue === 'number' ? headerValue.toString() : headerValue
} }
} }
const additionalValue = additionalHeaders[header] const additionalValue = additionalHeaders[header]
if (additionalValue !== undefined) { if (additionalValue !== undefined) {
return typeof additionalValue === 'number' ? additionalValue.toString() : additionalValue return typeof additionalValue === 'number'
? additionalValue.toString()
: additionalValue
} }
if (clientHeader !== undefined) { if (clientHeader !== undefined) {
@@ -657,7 +663,9 @@ export class HttpClient {
): string { ): string {
let clientHeader: string | undefined let clientHeader: string | undefined
if (this.requestOptions && this.requestOptions.headers) { 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 (headerValue) {
if (typeof headerValue === 'number') { if (typeof headerValue === 'number') {
clientHeader = String(headerValue) clientHeader = String(headerValue)