Skip to content

Commit 40cdf7d

Browse files
committed
Restore query_string type check in StringQueryMatcher
1 parent 7a27540 commit 40cdf7d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pytest_httpserver/httpserver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ def __init__(self, query_string: bytes | str) -> None:
201201
self.query_string = query_string
202202

203203
def get_comparing_values(self, request_query_string: bytes) -> tuple[bytes, bytes]:
204+
if not isinstance(self.query_string, (str, bytes)):
205+
raise TypeError("query_string must be a string, or a bytes-like object")
206+
204207
if isinstance(self.query_string, str):
205208
query_string = self.query_string.encode()
206209
else:

0 commit comments

Comments
 (0)