Skip to content

Commit 0ceebcf

Browse files
authored
v1.7.2 - fix node10 resolution (#16)
* v1.7.2-beta.1 - node resolution change for node10 support (#15) * v1.7.2 - use nodenext module resolution, which works on node10 * v1.7.2 - update changelog
1 parent 9bae9d6 commit 0ceebcf

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## v1.7.2 - 06/21/2023
7+
8+
### Fixed
9+
- Added try-catch best effort for gzip json response decompression from nuget.org
10+
- Compile with nodenext moduleResolution so it implements a Promise resolver intead of yield on dynamic module resolution (node v13.2+)
11+
- Resolves node and node10 task runners
12+
613
## v1.7.0 - 06/13/2023
714

815
### Added

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/security-devops-azdevops-task-lib",
3-
"version": "1.7.0",
3+
"version": "1.7.2",
44
"description": "Microsoft Security DevOps for Azure DevOps task library.",
55
"author": "Microsoft Corporation",
66
"license": "MIT",

src/msdo-nuget-client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,13 @@ async function requestJson(url: string, options: Object): Promise<Object> {
531531
return new Promise((resolve, reject) => {
532532
tl.debug(`${options['method'].toUpperCase()} ${url}`);
533533
const req = https.request(url, options, async (res) => {
534-
// decompress the response if it's gzipped
535-
const decompressResponse = await import('decompress-response');
536-
res = decompressResponse.default(res);
534+
// attempt to decompress the response if it's gzipped
535+
try {
536+
const decompressResponse = await import('decompress-response');
537+
res = decompressResponse.default(res);
538+
} catch (error) {
539+
tl.debug(`Failed to add response decompression: ${error.message}`);
540+
}
537541

538542
if (res.statusCode !== 200) {
539543
reject(new Error(`Failed to call: ${url}. Status code: ${res.statusCode}`));

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "es6",
44
"module": "commonjs",
5-
"moduleResolution": "node16",
5+
"moduleResolution": "nodenext",
66
"lib": [
77
"es6"
88
],

0 commit comments

Comments
 (0)