Loading dist/restore/index.js +29 −4 Changes for dist/restore/index.js: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2182,12 +2182,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const crypto = __importStar(__webpack_require__(417)); const http_client_1 = __webpack_require__(539); const auth_1 = __webpack_require__(226); const utils = __importStar(__webpack_require__(443)); const crypto = __importStar(__webpack_require__(417)); const fs = __importStar(__webpack_require__(747)); const constants_1 = __webpack_require__(694); const utils = __importStar(__webpack_require__(443)); const versionSalt = "1.0"; function isSuccessStatusCode(statusCode) { if (!statusCode) { Loading Loading @@ -2285,7 +2285,24 @@ function downloadCache(archiveLocation, archivePath) { const stream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield httpClient.get(archiveLocation); // Abort download if no traffic received over the socket. downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); core.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, stream); // Validate download size. const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { const expectedLength = parseInt(contentLengthHeader); const actualLength = utils.getArchiveFileSize(archivePath); if (actualLength != expectedLength) { throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { core.debug("Unable to validate download, no Content-Length header"); } }); } exports.downloadCache = downloadCache; Loading Loading @@ -3185,8 +3202,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); Loading Loading @@ -3583,6 +3600,12 @@ class HttpClientResponse { this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('aborted', () => { reject("Request was aborted or closed prematurely"); }); this.message.on('timeout', (socket) => { reject("Request timed out"); }); this.message.on('end', () => { resolve(output.toString()); }); Loading Loading @@ -3704,6 +3727,7 @@ class HttpClient { let response; while (numTries < maxTries) { response = await this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; Loading Loading @@ -4468,6 +4492,7 @@ var Events; Events["PullRequest"] = "pull_request"; })(Events = exports.Events || (exports.Events = {})); exports.CacheFilename = "cache.tgz"; exports.SocketTimeout = 5000; /***/ }), Loading dist/save/index.js +29 −4 Changes for dist/save/index.js: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2182,12 +2182,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const crypto = __importStar(__webpack_require__(417)); const http_client_1 = __webpack_require__(539); const auth_1 = __webpack_require__(226); const utils = __importStar(__webpack_require__(443)); const crypto = __importStar(__webpack_require__(417)); const fs = __importStar(__webpack_require__(747)); const constants_1 = __webpack_require__(694); const utils = __importStar(__webpack_require__(443)); const versionSalt = "1.0"; function isSuccessStatusCode(statusCode) { if (!statusCode) { Loading Loading @@ -2285,7 +2285,24 @@ function downloadCache(archiveLocation, archivePath) { const stream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield httpClient.get(archiveLocation); // Abort download if no traffic received over the socket. downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); core.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, stream); // Validate download size. const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { const expectedLength = parseInt(contentLengthHeader); const actualLength = utils.getArchiveFileSize(archivePath); if (actualLength != expectedLength) { throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { core.debug("Unable to validate download, no Content-Length header"); } }); } exports.downloadCache = downloadCache; Loading Loading @@ -3185,8 +3202,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); Loading Loading @@ -3583,6 +3600,12 @@ class HttpClientResponse { this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('aborted', () => { reject("Request was aborted or closed prematurely"); }); this.message.on('timeout', (socket) => { reject("Request timed out"); }); this.message.on('end', () => { resolve(output.toString()); }); Loading Loading @@ -3704,6 +3727,7 @@ class HttpClient { let response; while (numTries < maxTries) { response = await this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; Loading Loading @@ -4554,6 +4578,7 @@ var Events; Events["PullRequest"] = "pull_request"; })(Events = exports.Events || (exports.Events = {})); exports.CacheFilename = "cache.tgz"; exports.SocketTimeout = 5000; /***/ }), Loading src/cacheHttpClient.ts +1 −1 Changes for src/cacheHttpClient.ts: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ export async function downloadCache( await pipeResponseToStream(downloadResponse, stream); // Validate download size. var contentLengthHeader = const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { Loading Loading
dist/restore/index.js +29 −4 Changes for dist/restore/index.js: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2182,12 +2182,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const crypto = __importStar(__webpack_require__(417)); const http_client_1 = __webpack_require__(539); const auth_1 = __webpack_require__(226); const utils = __importStar(__webpack_require__(443)); const crypto = __importStar(__webpack_require__(417)); const fs = __importStar(__webpack_require__(747)); const constants_1 = __webpack_require__(694); const utils = __importStar(__webpack_require__(443)); const versionSalt = "1.0"; function isSuccessStatusCode(statusCode) { if (!statusCode) { Loading Loading @@ -2285,7 +2285,24 @@ function downloadCache(archiveLocation, archivePath) { const stream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield httpClient.get(archiveLocation); // Abort download if no traffic received over the socket. downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); core.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, stream); // Validate download size. const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { const expectedLength = parseInt(contentLengthHeader); const actualLength = utils.getArchiveFileSize(archivePath); if (actualLength != expectedLength) { throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { core.debug("Unable to validate download, no Content-Length header"); } }); } exports.downloadCache = downloadCache; Loading Loading @@ -3185,8 +3202,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); Loading Loading @@ -3583,6 +3600,12 @@ class HttpClientResponse { this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('aborted', () => { reject("Request was aborted or closed prematurely"); }); this.message.on('timeout', (socket) => { reject("Request timed out"); }); this.message.on('end', () => { resolve(output.toString()); }); Loading Loading @@ -3704,6 +3727,7 @@ class HttpClient { let response; while (numTries < maxTries) { response = await this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; Loading Loading @@ -4468,6 +4492,7 @@ var Events; Events["PullRequest"] = "pull_request"; })(Events = exports.Events || (exports.Events = {})); exports.CacheFilename = "cache.tgz"; exports.SocketTimeout = 5000; /***/ }), Loading
dist/save/index.js +29 −4 Changes for dist/save/index.js: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2182,12 +2182,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const crypto = __importStar(__webpack_require__(417)); const http_client_1 = __webpack_require__(539); const auth_1 = __webpack_require__(226); const utils = __importStar(__webpack_require__(443)); const crypto = __importStar(__webpack_require__(417)); const fs = __importStar(__webpack_require__(747)); const constants_1 = __webpack_require__(694); const utils = __importStar(__webpack_require__(443)); const versionSalt = "1.0"; function isSuccessStatusCode(statusCode) { if (!statusCode) { Loading Loading @@ -2285,7 +2285,24 @@ function downloadCache(archiveLocation, archivePath) { const stream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield httpClient.get(archiveLocation); // Abort download if no traffic received over the socket. downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); core.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, stream); // Validate download size. const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { const expectedLength = parseInt(contentLengthHeader); const actualLength = utils.getArchiveFileSize(archivePath); if (actualLength != expectedLength) { throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { core.debug("Unable to validate download, no Content-Length header"); } }); } exports.downloadCache = downloadCache; Loading Loading @@ -3185,8 +3202,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); Loading Loading @@ -3583,6 +3600,12 @@ class HttpClientResponse { this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('aborted', () => { reject("Request was aborted or closed prematurely"); }); this.message.on('timeout', (socket) => { reject("Request timed out"); }); this.message.on('end', () => { resolve(output.toString()); }); Loading Loading @@ -3704,6 +3727,7 @@ class HttpClient { let response; while (numTries < maxTries) { response = await this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; Loading Loading @@ -4554,6 +4578,7 @@ var Events; Events["PullRequest"] = "pull_request"; })(Events = exports.Events || (exports.Events = {})); exports.CacheFilename = "cache.tgz"; exports.SocketTimeout = 5000; /***/ }), Loading
src/cacheHttpClient.ts +1 −1 Changes for src/cacheHttpClient.ts: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ export async function downloadCache( await pipeResponseToStream(downloadResponse, stream); // Validate download size. var contentLengthHeader = const contentLengthHeader = downloadResponse.message.headers["content-length"]; if (contentLengthHeader) { Loading