mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-20 06:38:03 +08:00
artifact header cleanup (#441)
* Update NPM packages for @actions/artifact * Clarifications around headers * Revert NPM updates * Apply suggestions from code review Co-authored-by: Josh Gross <joshmgross@github.com> Co-authored-by: Josh Gross <joshmgross@github.com>
This commit is contained in:
@@ -62,7 +62,6 @@ export function isForbiddenStatusCode(statusCode?: number): boolean {
|
||||
if (!statusCode) {
|
||||
return false
|
||||
}
|
||||
|
||||
return statusCode === HttpCodes.Forbidden
|
||||
}
|
||||
|
||||
@@ -84,7 +83,6 @@ export function isThrottledStatusCode(statusCode?: number): boolean {
|
||||
if (!statusCode) {
|
||||
return false
|
||||
}
|
||||
|
||||
return statusCode === HttpCodes.TooManyRequests
|
||||
}
|
||||
|
||||
@@ -133,9 +131,9 @@ export function getContentRange(
|
||||
* @param {boolean} isKeepAlive is the same connection being used to make multiple calls
|
||||
* @param {boolean} acceptGzip can we accept a gzip encoded response
|
||||
* @param {string} acceptType the type of content that we can accept
|
||||
* @returns appropriate request options to make a specific http call during artifact download
|
||||
* @returns appropriate headers to make a specific http call during artifact download
|
||||
*/
|
||||
export function getDownloadRequestOptions(
|
||||
export function getDownloadHeaders(
|
||||
contentType: string,
|
||||
isKeepAlive?: boolean,
|
||||
acceptGzip?: boolean
|
||||
@@ -172,9 +170,9 @@ export function getDownloadRequestOptions(
|
||||
* @param {number} uncompressedLength the original size of the content if something is being uploaded that has been compressed
|
||||
* @param {number} contentLength the length of the content that is being uploaded
|
||||
* @param {string} contentRange the range of the content that is being uploaded
|
||||
* @returns appropriate request options to make a specific http call during artifact upload
|
||||
* @returns appropriate headers to make a specific http call during artifact upload
|
||||
*/
|
||||
export function getUploadRequestOptions(
|
||||
export function getUploadHeaders(
|
||||
contentType: string,
|
||||
isKeepAlive?: boolean,
|
||||
isGzip?: boolean,
|
||||
@@ -207,7 +205,7 @@ export function getUploadRequestOptions(
|
||||
}
|
||||
|
||||
export function createHttpClient(): HttpClient {
|
||||
return new HttpClient('action/artifact', [
|
||||
return new HttpClient('actions/artifact', [
|
||||
new BearerCredentialHandler(getRuntimeToken())
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user