diff options
author | cmedrala <77509897+cmedrala@users.noreply.github.com> | 2022-09-21 12:04:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 12:04:37 +0200 |
commit | 01b37faba6da70835fed3f2ac27647a4550b352d (patch) | |
tree | 5954639766575ebdb1aa39c78381ec80a8f1ad6c | |
parent | 3fe62d2869677f8d0c12f0922d37982cbf819a5e (diff) | |
download | pygments-git-01b37faba6da70835fed3f2ac27647a4550b352d.tar.gz |
HTTP: add CONNECT keyword (#2242)
-rw-r--r-- | pygments/lexers/textfmts.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py index e67410ac..b6f635c7 100644 --- a/pygments/lexers/textfmts.py +++ b/pygments/lexers/textfmts.py @@ -173,7 +173,7 @@ class HttpLexer(RegexLexer): 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), @@ -195,7 +195,7 @@ class HttpLexer(RegexLexer): def analyse_text(text): return text.startswith(('GET /', 'POST /', 'PUT /', 'DELETE /', 'HEAD /', - 'OPTIONS /', 'TRACE /', 'PATCH /')) + 'OPTIONS /', 'TRACE /', 'PATCH /', 'CONNECT ')) class TodotxtLexer(RegexLexer): |