Skip to content

Commit b989ceb

Browse files
authored
chore(httpie): move from @myunisoft/httpie to @openally/httpie (#530)
1 parent 02f111e commit b989ceb

File tree

8 files changed

+23
-12
lines changed

8 files changed

+23
-12
lines changed

.changeset/spotty-showers-prove.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@nodesecure/conformance": minor
3+
"@nodesecure/github": minor
4+
"@nodesecure/gitlab": minor
5+
---
6+
7+
chore(httpie): move from @myunisoft/httpie to @openally/httpie

package-lock.json

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

workspaces/conformance/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"homepage": "https://github.com/NodeSecure/tree/master/workspaces/conformance#readme",
3737
"devDependencies": {
38-
"@myunisoft/httpie": "^5.0.1",
38+
"@openally/httpie": "^1.0.0",
3939
"@types/spdx-expression-parse": "^3.0.5",
4040
"node-estree": "^4.0.0"
4141
},

workspaces/conformance/scripts/fetchSpdxLicenses.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import fs from "node:fs";
33

44
// Import Third-party Dependencies
5-
import httpie from "@myunisoft/httpie";
5+
import * as httpie from "@openally/httpie";
66
import * as astring from "astring";
77
import { ESTree, Helpers, VarDeclaration } from "node-estree";
88

workspaces/github/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"homepage": "https://github.com/NodeSecure/scanner/tree/master/workspaces/github#readme",
3434
"dependencies": {
35-
"@myunisoft/httpie": "^5.0.0",
35+
"@openally/httpie": "^1.0.0",
3636
"tar-fs": "^3.0.5"
3737
},
3838
"devDependencies": {

workspaces/github/src/functions/download.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import * as path from "node:path";
33
import { createWriteStream } from "node:fs";
44

55
// Import Third-party Dependencies
6-
import httpie from "@myunisoft/httpie";
6+
import * as httpie from "@openally/httpie";
77

88
// CONSTANTS
99
const kGithubURL = new URL("https://github.com/");
1010
const kDefaultBranch = "main";
1111

12+
const agent = new httpie.Agent().compose(httpie.interceptors.redirect({ maxRedirections: 1 }));
13+
1214
export interface DownloadOptions {
1315
/**
1416
* The destination (location) to extract the tar.gz
@@ -71,7 +73,7 @@ export async function download(
7173
"Accept-Encoding": "gzip, deflate",
7274
Authorization: typeof token === "string" ? `token ${token}` : void 0
7375
},
74-
maxRedirections: 1
76+
agent
7577
});
7678
await writableCallback(() => createWriteStream(location));
7779

workspaces/gitlab/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"homepage": "https://github.com/NodeSecure/scanner/tree/master/workspaces/gitlab#readme",
3232
"dependencies": {
33-
"@myunisoft/httpie": "^5.0.0",
33+
"@openally/httpie": "^1.0.0",
3434
"tar-fs": "^3.0.6"
3535
},
3636
"devDependencies": {

workspaces/gitlab/src/functions/download.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from "node:fs";
66

77
// Import Third-party Dependencies
8-
import httpie from "@myunisoft/httpie";
8+
import * as httpie from "@openally/httpie";
99

1010
// Import Internal Dependencies
1111
import * as utils from "../utils.js";
@@ -51,6 +51,8 @@ export interface DownloadResult {
5151
branch: string;
5252
}
5353

54+
const agent = new httpie.Agent().compose(httpie.interceptors.redirect({ maxRedirections: 1 }));
55+
5456
export async function download(
5557
repository: string,
5658
options: DownloadOptions = Object.create(null)
@@ -73,7 +75,7 @@ export async function download(
7375
const repositoryURL = new URL(utils.getRepositoryPath(repository), gitlab);
7476
const { data: gitlabManifest } = await httpie.get<gitlab.Project>(repositoryURL, {
7577
headers,
76-
maxRedirections: 1
78+
agent
7779
});
7880

7981
const wantedBranch = typeof branch === "string" ? branch : gitlabManifest.default_branch;
@@ -86,7 +88,7 @@ export async function download(
8688
);
8789
const writableCallback = httpie.stream("GET", archiveURL, {
8890
headers: { ...headers, "Accept-Encoding": "gzip, deflate" },
89-
maxRedirections: 1
91+
agent
9092
});
9193
await writableCallback(() => createWriteStream(location));
9294

0 commit comments

Comments
 (0)