Skip to content

Commit

Permalink
Resolve path for hsts-preload.json file (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
bikerdave authored Jul 23, 2024
1 parent d2b3dc6 commit 0ea5178
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/analyzer/hsts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "fs";
import path from "path";

/**
* @type {import("../types.js").Hsts | null}
Expand All @@ -12,7 +13,7 @@ export function hsts() {
if (!hstsMap) {
hstsMap = new Map(
Object.entries(
JSON.parse(fs.readFileSync("conf/hsts-preload.json", "utf8"))
JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, "../../conf/hsts-preload.json"), "utf8"))
)
);
}
Expand Down

0 comments on commit 0ea5178

Please sign in to comment.