Skip to content

Fix comparison of quoted URLs - #22

Merged
arj03 merged 2 commits into
iterasdev:masterfrom
raphaelm:quoting
Mar 10, 2026
Merged

arj03 merged 2 commits into
iterasdev:masterfrom
raphaelm:quoting

Conversation

@raphaelm

Copy link
Copy Markdown
Collaborator

The current code compares quoted URLs, i.e. quoted_url.endswith(quote(document_type)). However, URL encoding is case-insensitive, so this fails if the SMP escapes characters in their URL with e.g. %3a, but Python quote quotes with %3A. This PR flips the check by comparing unquote(quoted_url).endswith(document_type) which should remove any inconsistencies on quoting.

Sorry, this will cause a one-line conflict with #21, but I wanted to keep the changes understandable and clean. Can also resolve it myself.

raphaelm and others added 2 commits March 10, 2026 09:45
The current code compares quoted URLs, i.e. `quoted_url.endswith(quote(document_type))`.
However, URL encoding is case-insensitive, so this fails if the SMP
escapes characters in their URL with e.g. %3a, but Python `quote` quotes with %3A.
This PR flips the check by comparing `unquote(quoted_url).endswith(document_type)`
which should remove any inconsistencies on quoting.
@arj03

arj03 commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks

@arj03
arj03 merged commit 166f4e9 into iterasdev:master Mar 10, 2026
2 checks passed
@raphaelm
raphaelm deleted the quoting branch March 10, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants