Skip to content

Commit

Permalink
Log raw bytes for invalid request line (#1313)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
abhinavsingh and pre-commit-ci[bot] authored Feb 22, 2023
1 parent 87ebb93 commit 4a2eb93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ extend-ignore =
WPS612 # FIXME: useless `__init__()` override
WPS613 # FIXME: unmatching super method access
WPS615 # FIXME: unpythonic setter/getter
PT027 # FIXME: use pytest.raises() instead of unittest-style 'assertRaises'

# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
format = wemake
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- --py36-plus

- repo: https://github.com/timothycrosley/isort.git
rev: 5.10.0
rev: 5.12.0
hooks:
- id: isort
args:
Expand Down
4 changes: 3 additions & 1 deletion proxy/http/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ def _process_line(
break
# To avoid a possible attack vector, we raise exception
# if parser receives an invalid request line.
raise HttpProtocolException('Invalid request line %r' % raw)
raise HttpProtocolException(
'Invalid request line %r' % raw.tobytes(),
)
parts = line.split(WHITESPACE, 2)
self.version = parts[0]
self.code = parts[1]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ commands =
. "{toxworkdir}/docs_out"
changedir = {[testenv:build-docs]changedir}
deps =
sphinxcontrib-spelling >= 7.2.0
sphinxcontrib-spelling == 7.7.0
-r{toxinidir}/docs/requirements.in
description = Spellcheck The Docs
isolated_build = {[testenv:build-docs]isolated_build}
Expand Down

0 comments on commit 4a2eb93

Please sign in to comment.