Skip to content
Permalink
Browse files
HPKP: Improved tokenization (#3278)
  • Loading branch information
RunDevelopment committed Dec 18, 2021
1 parent 3d708b9 commit 0f1b5810fa95add9a3b5d4d9cb243e02a0407d6f
@@ -6,15 +6,9 @@

Prism.languages.hpkp = {
'directive': {
pattern: /\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/,
alias: 'keyword'
pattern: /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i,
alias: 'property'
},
'safe': {
pattern: /\b\d{7,}\b/,
alias: 'selector'
},
'unsafe': {
pattern: /\b\d{1,6}\b/,
alias: 'function'
}
'operator': /=/,
'punctuation': /;/
};

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,13 @@
max-age=123;
max-age=31536000

----------------------------------------------------

[
["directive", "max-age"], ["operator", "="], "123", ["punctuation", ";"],
["directive", "max-age"], ["operator", "="], "31536000"
]

----------------------------------------------------

Checks for HPKP with an "unsafe" max-age.

This file was deleted.

@@ -3,7 +3,11 @@ pin-sha256="EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4="
----------------------------------------------------

[
["directive", "pin-sha256=\"EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4=\""]
["directive", "pin-sha256"],
["operator", "="],
"\"EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4",
["operator", "="],
"\""
]

----------------------------------------------------

This file was deleted.

0 comments on commit 0f1b581

Please sign in to comment.