Skip to content

Commit a940723

Browse files
author
CometAPI
committed
fix: normalize special-scheme backslashes
1 parent 30ac050 commit a940723

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def _canonical_actions_run_violations(
690690
decoded = re.sub(r"\\([/\\.:?&=%#])", r"\1", decoded)
691691
decoded = decoded.replace("\t", "").replace("\n", "").replace("\r", "")
692692
decoded = re.sub(
693-
r"(?i)(https?://[^\s<>)\]]*)\\([^\s<>)\]]*)",
693+
r"(?i)(https?:[^\s<>)\]]*)\\([^\s<>)\]]*)",
694694
lambda match: match.group(0).replace("\\", "/"),
695695
decoded,
696696
)

tests/test_release_documents.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,10 @@ def test_release_evidence_rejects_obsolete_workflow_reference_marker(
718718
"https://evil.example/?next=https://github.com/cometapi-dev/cometapi-python%5Cactions%5Cruns%5C30511373822",
719719
'<a href="https://github.com/cometapi-dev/cometapi-python/'
720720
'act&#9;ions/runs/30511373822">Required CI</a>',
721+
"https:\\github.com\\cometapi-dev\\cometapi-python\\actions\\runs\\30511373822",
722+
"https:\\\\github.com\\cometapi-dev\\cometapi-python\\actions\\runs\\30511373822",
723+
"https:/\\github.com\\cometapi-dev\\cometapi-python\\actions\\runs\\30511373822",
724+
"https:\\/github.com\\cometapi-dev\\cometapi-python\\actions\\runs\\30511373822",
721725
"https://github.com/cometapi-dev/cometapi-python/actions/runs/30511373822.evil",
722726
"https://github.com/cometapi-dev/cometapi-python/actions/runs/30511373822/attempts/0",
723727
],

0 commit comments

Comments
 (0)