Skip to content
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

Incorrect Reserved Expansion #99

Open
watuwo opened this issue Nov 5, 2022 · 0 comments
Open

Incorrect Reserved Expansion #99

watuwo opened this issue Nov 5, 2022 · 0 comments

Comments

@watuwo
Copy link

watuwo commented Nov 5, 2022

Valid UTF-8-percent-encoded code points must be preserved in reserved expansion. This implementation (Version: 4.1.1) fails the following test from https://github.com/uri-templates/uritemplate-test/blob/master/extended-tests.json:

{
  ...
  "Additional Examples 6: Reserved Expansion": {
    "variables" : {
      "id" : "admin%2F",
      ...
  },
  "testcases": [
    ["{+id}", "admin%2F"],
    ...
  ]
}

The correct/expected expansion is 'admin%2F', the actual expansion is 'admin%252F':

>>> from uritemplate import URITemplate, expand
>>> URITemplate('{+id}').expand(id='admin%2F')
'admin%252F'
>>> expand('{+id}', id='admin%2F')
'admin%252F'
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

No branches or pull requests

1 participant