Skip to content

fix missing check in strip_prefix - #132

Open
Mattcrmx wants to merge 1 commit into
chanced:mainfrom
Mattcrmx:main
Open

Mattcrmx wants to merge 1 commit into
chanced:mainfrom
Mattcrmx:main

Conversation

@Mattcrmx

@Mattcrmx Mattcrmx commented Nov 4, 2026

Copy link
Copy Markdown

This PR fixes the issue #131 (and reuses its very nice example for the added test),

strip_prefix("/foo") removed the prefix as plain text. On /foo/x that leaves /x, which is fine, but on /fooaé/x it leaves aé/x, because /foo stopped halfway through the token fooaé. The fix adds one check: after removing the prefix, the rest must be empty or start with /. If not, strip_prefix returns None.

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.

1 participant