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

Document a new functions to encode and decode parts of URI #3279

Closed
Tracked by #3543
TarantoolBot opened this issue Dec 27, 2022 · 0 comments · Fixed by #3587
Closed
Tracked by #3543

Document a new functions to encode and decode parts of URI #3279

TarantoolBot opened this issue Dec 27, 2022 · 0 comments · Fixed by #3587
Assignees
Labels
2.11 2.11 release and the associated technical debt feature A new functionality uri

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 27, 2022

Related dev. issue(s): tarantool/tarantool#3682

Product: Tarantool
Since: 2.11
Root document:

SME: @ ligurio

Details

New functions uri.escape() and uri.unescape() have been introduced.
First one allows to escape symbols to a string and second one to
unescape symbols to a string according to RFC 3986 [1].

Examples:

tarantool> uri.escape("тарантул")
---
- '%D1%82%D0%B0%D1%80%D0%B0%D0%BD%D1%82%D1%83%D0%BB'
...

tarantool> uri.unescape("%D1%82%D0%B0%D1%80%D0%B0%D0%BD%D1%82%D1%83%D0%BB")
---
- тарантул
...

uri.escape() accepts a string that will be encoded and optionally a
table with encoding options: string with unreserved symbols that will
not be encoded and boolean option that enables/disables encoding of a
space characters as '+'. By default uri.escape() uses a set of
unreserved symbols defined in RFC 3986 ("2.3. Unreserved Characters")
and encoding of space characters as '+' is disabled. Table with default
encoding options is defined as uri.RFC3986.

uri.unescape() accepts a string that will be decoded and optionally a
table with decoding options: string with unreserved symbols (these
symbols are actually unused by decoding function) and boolean option
that enables/disables decoding of '+' as a space character. Table with
default decoding options is defined as uri.RFC3986.

See detailed description in RFC "http: add percent-encoding/decoding of
query string in request" [2].

NO_WRAP

  1. Uniform Resource Identifier (URI): Generic Syntax
    https://datatracker.ietf.org/doc/html/rfc3986
  2. https://www.notion.so/tarantool/http-add-percent-encoding-decoding-of-query-string-in-request-76a2425a4c4744a1a72643527a4fe7f7
    NO_WRAP
    Requested by @ ligurio in tarantool/tarantool@5ebe186.
@veod32 veod32 added feature A new functionality server [area] Task relates to Tarantool's server (core) functionality labels Jan 19, 2023
@veod32 veod32 added uri 2.11 2.11 release and the associated technical debt and removed server [area] Task relates to Tarantool's server (core) functionality labels Mar 6, 2023
@andreyaksenov andreyaksenov self-assigned this Jul 14, 2023
@andreyaksenov andreyaksenov linked a pull request Jul 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11 2.11 release and the associated technical debt feature A new functionality uri
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants