Skip to content

Commit 938f4d8

Browse files
test(etag): add regression test for codepoints above 0xFF
Add test for parsing invalid entity-tag characters above obs-text.
1 parent d08cbc6 commit 938f4d8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/dexpace-sdk-core/tests/http/test_etag.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ def test_parse_embedded_space_raises() -> None:
5858
ETag.parse('"a b"')
5959

6060

61+
def test_parse_above_obs_text_raises() -> None:
62+
# RFC 7232 §2.3: obs-text tops out at 0xFF; codepoints above
63+
# that (e.g. U+20AC) are not valid entity-tag characters.
64+
with pytest.raises(ValueError):
65+
ETag.parse('"a€b"')
66+
67+
6168
def test_parse_empty_strong_etag_raises() -> None:
6269
with pytest.raises(ValueError, match="empty"):
6370
ETag.parse('""')

0 commit comments

Comments
 (0)