Skip to content

Commit

Permalink
Required Connect Header Validation
Browse files Browse the repository at this point in the history
* Make the ':authority' pseudo-header required.
* Make the ':scheme' and ':path' pseudo-headers optional.
  • Loading branch information
silverbucket authored and jlaine committed Jul 22, 2021
1 parent 5bcccb7 commit a18a6cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aioquic/h3/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def validate_request_headers(headers: Headers) -> None:
# we use it for the WebSocket demo.
(b":method", b":scheme", b":authority", b":path", b":protocol")
),
required_pseudo_headers=frozenset((b":method", b":scheme", b":path")),
required_pseudo_headers=frozenset((b":method", b":authority")),
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ def test_validate_request_headers(self):
validate_request_headers([(b":method", b"GET")])
self.assertEqual(
cm.exception.reason_phrase,
"Pseudo-headers [b':path', b':scheme'] are missing",
"Pseudo-headers [b':authority'] are missing",
)

# empty :authority pseudo-header for http/https
Expand Down

0 comments on commit a18a6cf

Please sign in to comment.