Skip to content

allow ptc-encoded entities in fragment #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
conitrade-as opened this issue Nov 7, 2023 · 0 comments · Fixed by #317
Closed

allow ptc-encoded entities in fragment #316

conitrade-as opened this issue Nov 7, 2023 · 0 comments · Fixed by #317
Labels
bug Issue: Works not as designed

Comments

@conitrade-as
Copy link
Contributor

In #305 the fragment matching was improved. However, the current regex does not allow pct-encoded entities (see https://datatracker.ietf.org/doc/html/rfc3986#section-3.5) to be present.

The RFC states that:

  • fragment = *( pchar / "/" / "?" )
  • pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
  • pct-encoded = "%" HEXDIG HEXDIG

The used regular expression does not match the following valid example:

import re
fragment = '2022%201040%20(Cornelius%20Morgan%20G).pdf'
re.fullmatch(r"[0-9a-zA-Z?/:@\-._~!$&'()*+,;=]*", fragment)
@yozachar yozachar added the bug Issue: Works not as designed label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Works not as designed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants