Skip to content

Commit 4e7b2a8

Browse files
authoredJan 16, 2021
HTTP: Allow root path in request line (#2711)
1 parent 59f725d commit 4e7b2a8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
 

‎components/prism-http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function (Prism) {
22
Prism.languages.http = {
33
'request-line': {
4-
pattern: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\s(?:https?:\/\/|\/)\S+\sHTTP\/[0-9.]+/m,
4+
pattern: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,
55
inside: {
66
// HTTP Verb
77
'property': /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,

‎components/prism-http.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/http/request-line_feature.test

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PATCH http://example.com HTTP/1.0
77
TRACE http://example.com HTTP/1.0
88
CONNECT http://example.com HTTP/1.0
99
GET /path/to/foo.html HTTP/1.1
10+
GET / HTTP/1.1
1011

1112
----------------------------------------------------
1213

@@ -48,9 +49,13 @@ GET /path/to/foo.html HTTP/1.1
4849
["request-line", [
4950
["property", "GET"],
5051
" /path/to/foo.html HTTP/1.1"
52+
]],
53+
["request-line", [
54+
["property", "GET"],
55+
" / HTTP/1.1"
5156
]]
5257
]
5358

5459
----------------------------------------------------
5560

56-
Checks for request lines.
61+
Checks for request lines.

0 commit comments

Comments
 (0)
Please sign in to comment.