Skip to content

Commit

Permalink
fix: test script protocols insensitively (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Sep 28, 2023
1 parent 42dba88 commit f437a3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function hasProtocol(
);
}

const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/;
const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i;

export function isScriptProtocol(protocol?: string) {
return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);
Expand Down
1 change: 1 addition & 0 deletions test/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe("isScriptProtocol", () => {
{ input: "blob:", out: true },
{ input: "data:", out: true },
{ input: "javascript:", out: true },
{ input: "javaScript:", out: true },
{ input: "vbscript:", out: true },
{ input: "\0vbscript:", out: true },
];
Expand Down

0 comments on commit f437a3b

Please sign in to comment.