From 01b37faba6da70835fed3f2ac27647a4550b352d Mon Sep 17 00:00:00 2001 From: cmedrala <77509897+cmedrala@users.noreply.github.com> Date: Wed, 21 Sep 2022 12:04:37 +0200 Subject: [PATCH] HTTP: add CONNECT keyword (#2242) --- pygments/lexers/textfmts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py index e67410ac91..b6f635c788 100644 --- a/pygments/lexers/textfmts.py +++ b/pygments/lexers/textfmts.py @@ -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), @@ -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):