Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/owasp.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class OWASP {
const headerJSON = await new Promise((resolve, reject) => {
const req = https
.get(
"https://owasp.org/www-project-secure-headers/ci/headers_add.json",
"https://raw.githubusercontent.com/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json",
Comment thread
JaredCE marked this conversation as resolved.
(res) => {
let data = [];

Expand Down
12 changes: 6 additions & 6 deletions test/unit/owasp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const newOWASPJSON = require("../json/newOWASP.json");
describe(`owasp`, function () {
describe(`getLatest`, function () {
it(`populates the defaults from the included OWASP release when the online version can not be reached`, async function () {
nock("https://owasp.org")
.get("/www-project-secure-headers/ci/headers_add.json")
nock("https://raw.githubusercontent.com")
.get("/OWASP/www-project-secure-headers/refs/heads/master/ci/headers_add.json")
.reply(404, {});

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

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

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

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

await owasp.getLatest().catch((err) => {
Expand Down
Loading