Skip to content

Commit 39e53aa

Browse files
committed
fix: handle optional % prefix before hex payload in masked inspect URLs
Some Steam clients prepend a literal % before the hex payload in masked inspect URLs (e.g. csgo_econ_action_preview%20%FDED5D6F...). This was causing deserialization to fail with "Payload too short or invalid hex".
1 parent ba8eee8 commit 39e53aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cs2_inspect/inspect_link.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
)
4444

4545
_MASKED_URL_RE = re.compile(
46-
r'csgo_econ_action_preview(?:%20|\s)[0-9A-Fa-f]{10,}$',
46+
r'csgo_econ_action_preview(?:%20|\s)%?[0-9A-Fa-f]{10,}$',
4747
re.IGNORECASE,
4848
)
4949

@@ -66,7 +66,7 @@ def _extract_hex(hex_or_url: str) -> str:
6666

6767
# Pure masked format: csgo_econ_action_preview%20<hexblob> (no S/A/M prefix).
6868
# Also handles payloads whose first hex character happens to be A.
69-
mm = re.search(r'csgo_econ_action_preview(?:%20|\s|\+)([0-9A-Fa-f]{10,})$', stripped, re.IGNORECASE)
69+
mm = re.search(r'csgo_econ_action_preview(?:%20|\s|\+)%?([0-9A-Fa-f]{10,})$', stripped, re.IGNORECASE)
7070
if mm:
7171
return mm.group(1)
7272

0 commit comments

Comments
 (0)