Skip to content

Commit f8a9b9e

Browse files
authored
Merge pull request #276 from alegarciadelrio/fix/owasp-migrated-endpoint
fix: update OWASP data source to use raw GitHub URL (issue #275)
2 parents 4c37b47 + c66b106 commit f8a9b9e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/owasp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class OWASP {
9595
const headerJSON = await new Promise((resolve, reject) => {
9696
const req = https
9797
.get(
98-
"https://owasp.org/www-project-secure-headers/ci/headers_add.json",
98+
"https://raw.githubusercontent.com/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json",
9999
(res) => {
100100
let data = [];
101101

test/unit/owasp.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const newOWASPJSON = require("../json/newOWASP.json");
1111
describe(`owasp`, function () {
1212
describe(`getLatest`, function () {
1313
it(`populates the defaults from the included OWASP release when the online version can not be reached`, async function () {
14-
nock("https://owasp.org")
15-
.get("/www-project-secure-headers/ci/headers_add.json")
14+
nock("https://raw.githubusercontent.com")
15+
.get("/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json")
1616
.reply(404, {});
1717

1818
await owasp.getLatest().catch((err) => {
@@ -33,8 +33,8 @@ describe(`owasp`, function () {
3333
});
3434

3535
it(`populates the defaults with information from a new OWASP release`, async function () {
36-
nock("https://owasp.org")
37-
.get("/www-project-secure-headers/ci/headers_add.json")
36+
nock("https://raw.githubusercontent.com")
37+
.get("/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json")
3838
.reply(200, newOWASPJSON);
3939

4040
await owasp.getLatest().catch((err) => {
@@ -59,8 +59,8 @@ describe(`owasp`, function () {
5959
const newOWASPJSONAdded = structuredClone(newOWASPJSON);
6060
newOWASPJSONAdded.headers.push({ name: "x-added", value: "true" });
6161

62-
nock("https://owasp.org")
63-
.get("/www-project-secure-headers/ci/headers_add.json")
62+
nock("https://raw.githubusercontent.com")
63+
.get("/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json")
6464
.reply(200, newOWASPJSONAdded);
6565

6666
await owasp.getLatest().catch((err) => {

0 commit comments

Comments
 (0)