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

Add path_unencoded function #176

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

last-genius
Copy link
Contributor

This is intended less as the suggested implementation (it simply follows the existing encoded_of_path one), but as a starting point for a discussion to include such function.

Its addition is motivated by several things:

  • To make .path interface similar to that of .query, which has both the encoded (verbatim) and the unencoded (default) version
  • To avoid unnecessary encoding->decoding that is required now to obtain an unencoded path like: Uri.path x |> Uri.pct_decode
  • It seems to be hard to achieve this through the existing interface of path ?pct_encoder, since the encoder relies on the list of safe characters - makes little sense to create a whitelist of all characters for this.

Adds a few utility functions ('Path.decoded_of_path', 'decoded_of_path')
as well, emulating the implementation of 'path'.

Signed-off-by: Andrii Sultanov <sultanovandriy@gmail.com>
@dinosaure dinosaure merged commit 8d6da91 into mirage:main Jul 22, 2024
4 of 5 checks passed
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