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,
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user