Skip to content

Commit

Permalink
HTTP: Absolute path is a valid request uri (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstapleton authored and Golmote committed Apr 12, 2018
1 parent 829e5cd commit f6e81cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-http.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Prism.languages.http = {
'request-line': {
pattern: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\shttps?:\/\/\S+\sHTTP\/[0-9.]+/m,
pattern: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\s(?:https?:\/\/|\/)\S+\sHTTP\/[0-9.]+/m,
inside: {
// HTTP Verb
property: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-http.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tests/languages/http/request-line_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ OPTIONS https://www.example.com HTTP/1.1
PATCH http://example.com HTTP/1.0
TRACE http://example.com HTTP/1.0
CONNECT http://example.com HTTP/1.0
GET /path/to/foo.html HTTP/1.1

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

Expand Down Expand Up @@ -43,6 +44,10 @@ CONNECT http://example.com HTTP/1.0
["request-line", [
["property", "CONNECT"],
" http://example.com HTTP/1.0"
]],
["request-line", [
["property", "GET"],
" /path/to/foo.html HTTP/1.1"
]]
]

Expand Down

0 comments on commit f6e81cb

Please sign in to comment.