Skip to content

Commit 162e659

Browse files
authored
Merge pull request #3 from BendingBender/fix-hash-type-and-typo
Correct type of THash type, fix typo
2 parents bb95b0e + f341308 commit 162e659

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

packages/csp-header/src/constants/values.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ export const ALLOW_MODALS = "allow-modals";
55
export const ALLOW_ORIENTATION_LOCK = "allow-orientation-lock";
66
export const ALLOW_POINTER_LOCK = "allow-pointer-lock";
77
export const ALLOW_POPUPS = "allow-popups";
8-
export const ALLOW_POPUPS_TO_ESACPE_SANDBOX = "allow-popups-to-escape-sandbox";
8+
export const ALLOW_POPUPS_TO_ESCAPE_SANDBOX = "allow-popups-to-escape-sandbox";
9+
/**
10+
* @deprecated
11+
*/
12+
export const ALLOW_POPUPS_TO_ESACPE_SANDBOX = ALLOW_POPUPS_TO_ESCAPE_SANDBOX;
913
export const ALLOW_PRESENTATION = "allow-presentation";
1014
export const ALLOW_SAME_ORIGIN = "allow-same-origin";
1115
export const ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION = "allow-storage-access-by-user-activation";

packages/csp-header/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
ALLOW_ORIENTATION_LOCK,
77
ALLOW_POINTER_LOCK,
88
ALLOW_POPUPS,
9-
ALLOW_POPUPS_TO_ESACPE_SANDBOX,
9+
ALLOW_POPUPS_TO_ESCAPE_SANDBOX,
1010
ALLOW_PRESENTATION,
1111
ALLOW_SAME_ORIGIN,
1212
ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION,
@@ -48,7 +48,7 @@ export type CSPPresetsArray = Partial<CSPDirectives>[];
4848

4949
type TSource = string;
5050
type TNonce = `nonce-${string}`;
51-
type THash = `sha-${string}`;
51+
type THash = `sha${'256' | '384' | '512'}-${string}`;
5252
type TMimeType = `${string}/${string}`;
5353

5454
type TFetchDirective = TSource |
@@ -111,7 +111,7 @@ export type CSPDirectives = {
111111
typeof ALLOW_ORIENTATION_LOCK |
112112
typeof ALLOW_POINTER_LOCK |
113113
typeof ALLOW_POPUPS |
114-
typeof ALLOW_POPUPS_TO_ESACPE_SANDBOX |
114+
typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX |
115115
typeof ALLOW_PRESENTATION |
116116
typeof ALLOW_SAME_ORIGIN |
117117
typeof ALLOW_SCRIPTS |

packages/express-csp-header/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export {
1717
ALLOW_ORIENTATION_LOCK,
1818
ALLOW_POINTER_LOCK,
1919
ALLOW_POPUPS,
20+
ALLOW_POPUPS_TO_ESCAPE_SANDBOX,
2021
ALLOW_POPUPS_TO_ESACPE_SANDBOX,
2122
ALLOW_PRESENTATION,
2223
ALLOW_SAME_ORIGIN,

0 commit comments

Comments
 (0)