Skip to content

Commit

Permalink
Fix for when the content-type header contains a carriage return
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-hall committed Aug 3, 2021
1 parent 7e6fb45 commit 93b9326
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http-request-response.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ first_line_match: |-
)
)
variables:
content_type_sep: (?=;|$)
content_type_sep: (?=;|\r?$)
multipart_form_data_boundary: (?:^---+.*$)
http_version: (?:\bHTTP/\d(?:\.\d)?\b)
end_of_body: (?=^{{http_version}}[ ]\d{3})
end_of_headers: (?:^$\n)
end_of_headers: (?:^\r?$\n)
media_type_suffix_prefix: (?:[\w.-]+/[\w.-]+)
contexts:
prototype:
Expand Down
20 changes: 20 additions & 0 deletions syntax_test_http.http
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,23 @@ vary: Accept-Encoding
<meta charset="utf-8">
</head>
## ^^^ meta.body text.html meta.tag.structure.any entity.name.tag.structure.any

HTTP/2 200
content-type: image/svg+xml; charset=UTF-8

<svg width="400" height="400">
<g class="xaxis axis" transform="translate(30,370)">
<g class="tick" style="opacity: 1;" transform="translate(0,0)">
<line y2="-340" x2="0" />
<text dy=".71em" style="text-anchor: middle;" y="3" x="0">-20</text>
</g>
<g class="tick" style="opacity: 1;" transform="translate(43.589743589743584,0)">
<line y2="-340" x2="0" />
<text dy=".71em" style="text-anchor: middle;" y="3" x="0">-15</text>
</g>
<g class="tick" style="opacity: 1;" transform="translate(87.17948717948717,0)">
<line y2="-340" x2="0" />
## ^^^^ meta.body text.xml meta.tag entity.name.tag.localname
<text dy=".71em" style="text-anchor: middle;" y="3" x="0">-10</text>
</g>
</svg>

0 comments on commit 93b9326

Please sign in to comment.