Skip to content

Commit

Permalink
v1.7.2 - fix node10 resolution (#16)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davidknise authored Jun 22, 2023
1 parent 9bae9d6 commit 0ceebcf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

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

## v1.7.2 - 06/21/2023

### Fixed
- Added try-catch best effort for gzip json response decompression from nuget.org
- Compile with nodenext moduleResolution so it implements a Promise resolver intead of yield on dynamic module resolution (node v13.2+)
- Resolves node and node10 task runners

## v1.7.0 - 06/13/2023

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/security-devops-azdevops-task-lib",
"version": "1.7.0",
"version": "1.7.2",
"description": "Microsoft Security DevOps for Azure DevOps task library.",
"author": "Microsoft Corporation",
"license": "MIT",
Expand Down
10 changes: 7 additions & 3 deletions src/msdo-nuget-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,13 @@ async function requestJson(url: string, options: Object): Promise<Object> {
return new Promise((resolve, reject) => {
tl.debug(`${options['method'].toUpperCase()} ${url}`);
const req = https.request(url, options, async (res) => {
// decompress the response if it's gzipped
const decompressResponse = await import('decompress-response');
res = decompressResponse.default(res);
// attempt to decompress the response if it's gzipped
try {
const decompressResponse = await import('decompress-response');
res = decompressResponse.default(res);
} catch (error) {
tl.debug(`Failed to add response decompression: ${error.message}`);
}

if (res.statusCode !== 200) {
reject(new Error(`Failed to call: ${url}. Status code: ${res.statusCode}`));
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node16",
"moduleResolution": "nodenext",
"lib": [
"es6"
],
Expand Down

0 comments on commit 0ceebcf

Please sign in to comment.