Skip to content

Commit 4a2eb93

Browse files
Log raw bytes for invalid request line (#1313)
* Log raw bytes for invalid request line * Upgrade isort to fix https://results.pre-commit.ci/run/github/12228178/1677045066.rNmdqVF5RLehPuIVg48STQ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * `.. spelling:word-list::` * Ignore `PT027` * Keep using `.. spelling::` * Pin to `sphinxcontrib-spelling == 7.7.2` as v8 causes deprecation warning issues * Pin to 7.2.0 * 7.2.1 * `7.7.0` had last success --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 87ebb93 commit 4a2eb93

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ extend-ignore =
187187
WPS612 # FIXME: useless `__init__()` override
188188
WPS613 # FIXME: unmatching super method access
189189
WPS615 # FIXME: unpythonic setter/getter
190+
PT027 # FIXME: use pytest.raises() instead of unittest-style 'assertRaises'
190191

191192
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
192193
format = wemake

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- --py36-plus
99

1010
- repo: https://github.com/timothycrosley/isort.git
11-
rev: 5.10.0
11+
rev: 5.12.0
1212
hooks:
1313
- id: isort
1414
args:

proxy/http/parser/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,9 @@ def _process_line(
417417
break
418418
# To avoid a possible attack vector, we raise exception
419419
# if parser receives an invalid request line.
420-
raise HttpProtocolException('Invalid request line %r' % raw)
420+
raise HttpProtocolException(
421+
'Invalid request line %r' % raw.tobytes(),
422+
)
421423
parts = line.split(WHITESPACE, 2)
422424
self.version = parts[0]
423425
self.code = parts[1]

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ commands =
143143
. "{toxworkdir}/docs_out"
144144
changedir = {[testenv:build-docs]changedir}
145145
deps =
146-
sphinxcontrib-spelling >= 7.2.0
146+
sphinxcontrib-spelling == 7.7.0
147147
-r{toxinidir}/docs/requirements.in
148148
description = Spellcheck The Docs
149149
isolated_build = {[testenv:build-docs]isolated_build}

0 commit comments

Comments
 (0)