Skip to content

Commit

Permalink
HTTP: add CONNECT keyword (#2242)
Browse files Browse the repository at this point in the history
  • Loading branch information
clairey-zx81 committed Sep 21, 2022
1 parent 3fe62d2 commit 01b37fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygments/lexers/textfmts.py
Expand Up @@ -173,7 +173,7 @@ def content_callback(self, match):

tokens = {
'root': [
(r'(GET|POST|PUT|DELETE|HEAD|OPTIONS|TRACE|PATCH)( +)([^ ]+)( +)'
(r'(GET|POST|PUT|DELETE|HEAD|OPTIONS|TRACE|PATCH|CONNECT)( +)([^ ]+)( +)'
r'(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)',
bygroups(Name.Function, Text, Name.Namespace, Text,
Keyword.Reserved, Operator, Number, Text),
Expand All @@ -195,7 +195,7 @@ def content_callback(self, match):

def analyse_text(text):
return text.startswith(('GET /', 'POST /', 'PUT /', 'DELETE /', 'HEAD /',
'OPTIONS /', 'TRACE /', 'PATCH /'))
'OPTIONS /', 'TRACE /', 'PATCH /', 'CONNECT '))


class TodotxtLexer(RegexLexer):
Expand Down

0 comments on commit 01b37fa

Please sign in to comment.