Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
HTTP: Added support for special header value tokenization (#3275)
- Loading branch information
Showing
with
345 additions
and 102 deletions.
- +1 −1 components.js
- +3 −0 components.json
- +46 −7 components/prism-http.js
- +1 −1 components/prism-http.min.js
- +5 −2 tests/languages/css+http/css_inclusion.test
- +20 −0 tests/languages/http!+csp/inclusion.test
- +31 −0 tests/languages/http!+hpkp/inclusion.test
- +15 −0 tests/languages/http!+hsts/inclusion.test
- +0 −24 tests/languages/http/header-name_feature.test
- +59 −0 tests/languages/http/header_feature.test
- +14 −0 tests/languages/http/text-plain_feature.test
- +25 −10 tests/languages/javascript+http/issue2733.test
- +5 −3 tests/languages/javascript+http/javascript_inclusion.test
- +25 −10 tests/languages/json+http/issue2733.test
- +40 −16 tests/languages/json+http/issue3168.test
- +5 −3 tests/languages/json+http/json-suffix_inclusion.test
- +5 −3 tests/languages/json+http/json_inclusion.test
- +5 −3 tests/languages/markup+http/html_inclusion.test
- +25 −10 tests/languages/markup+http/issue2733.test
- +5 −3 tests/languages/markup+http/text-xml_inclusion.test
- +5 −3 tests/languages/markup+http/xml-suffix_inclusion.test
- +5 −3 tests/languages/markup+http/xml_inclusion.test
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -559,7 +559,10 @@ | ||
"http": { | ||
"title": "HTTP", | ||
"optional": [ | ||
"csp", | ||
"css", | ||
"hpkp", | ||
"hsts", | ||
"javascript", | ||
"json", | ||
"markup", | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,20 @@ | ||
Content-Security-Policy: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header", [ | ||
["header-name", "Content-Security-Policy"], | ||
["punctuation", ":"], | ||
["header-value", [ | ||
["directive", "default-src"], | ||
["none", "'none'"], | ||
["punctuation", ";"], | ||
["directive", "style-src"], | ||
["host", ["cdn.example.com"]], | ||
["punctuation", ";"], | ||
["directive", "report-uri"], | ||
" /_/csp-reports" | ||
]] | ||
]] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,31 @@ | ||
Public-Key-Pins: max-age=3000; | ||
pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="; | ||
pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header", [ | ||
["header-name", "Public-Key-Pins"], | ||
["punctuation", ":"], | ||
["header-value", [ | ||
["directive", "max-age"], | ||
["operator", "="], | ||
"3000", | ||
["punctuation", ";"], | ||
|
||
["directive", "pin-sha256"], | ||
["operator", "="], | ||
"\"d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM", | ||
["operator", "="], | ||
"\"", | ||
["punctuation", ";"], | ||
|
||
["directive", "pin-sha256"], | ||
["operator", "="], | ||
"\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g", | ||
["operator", "="], | ||
"\"" | ||
]] | ||
]] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,15 @@ | ||
Strict-Transport-Security: max-age=31536000 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header", [ | ||
["header-name", "Strict-Transport-Security"], | ||
["punctuation", ":"], | ||
["header-value", [ | ||
["directive", "max-age"], | ||
["operator", "="], | ||
"31536000" | ||
]] | ||
]] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,59 @@ | ||
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 | ||
Accept-Encoding: gzip, deflate | ||
Server: GitHub.com | ||
Date: Mon, 22 Dec 2014 18:25:30 GMT | ||
Content-Type: text/html; charset=utf-8 | ||
Content-Security-Policy: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports | ||
Public-Key-Pins: max-age=3000; | ||
pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="; | ||
pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=" | ||
Strict-Transport-Security: max-age=31536000 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header", [ | ||
["header-name", "Accept-Language"], | ||
["punctuation", ":"], | ||
["header-value", "fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3"] | ||
]], | ||
["header", [ | ||
["header-name", "Accept-Encoding"], | ||
["punctuation", ":"], | ||
["header-value", "gzip, deflate"] | ||
]], | ||
["header", [ | ||
["header-name", "Server"], | ||
["punctuation", ":"], | ||
["header-value", "GitHub.com"] | ||
]], | ||
["header", [ | ||
["header-name", "Date"], | ||
["punctuation", ":"], | ||
["header-value", "Mon, 22 Dec 2014 18:25:30 GMT"] | ||
]], | ||
["header", [ | ||
["header-name", "Content-Type"], | ||
["punctuation", ":"], | ||
["header-value", "text/html; charset=utf-8"] | ||
]], | ||
["header", [ | ||
["header-name", "Content-Security-Policy"], | ||
["punctuation", ":"], | ||
["header-value", "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports"] | ||
]], | ||
["header", [ | ||
["header-name", "Public-Key-Pins"], | ||
["punctuation", ":"], | ||
["header-value", "max-age=3000;\r\n pin-sha256=\"d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM=\";\r\n pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\""] | ||
]], | ||
["header", [ | ||
["header-name", "Strict-Transport-Security"], | ||
["punctuation", ":"], | ||
["header-value", "max-age=31536000"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for header names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,14 @@ | ||
Content-Type: text/plain | ||
|
||
Hello World! | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header", [ | ||
["header-name", "Content-Type"], | ||
["punctuation", ":"], | ||
["header-value", "text/plain"] | ||
]], | ||
["text-plain", ["\r\nHello World!"]] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.