mirror of
https://github.com/actions/toolkit.git
synced 2026-08-07 00:00:18 +02:00
format
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user