Lagrange [work/v1.10]

Reserved characters in URLs

=> Jaakko Keränen

Mon Dec 27 10:00:17 2021 +0200

Making URL encoding a little less convoluted. Now when sending out a request, the URL is fully encoded except for reserved characters. In the internal representation, non-ASCII characters are in decoded form (i.e., IRI).

This means that if the user enters a URL in the input field manually, its non-ASCII characters will be percent encoded as well. However, in this case the user is expected to manually escape all reserved characters because the input field can't tell the difference between what is intended to be a reserved separator and what isn't. For example, a server might expect &-separated fields, and if the user enters such fields manually in the URL field, they shouldn't be converted to %26.

When forming a query URL in the input dialog, user-entered text is fully percent-encoded because in that case the input is just a generic text string.

IssueID #410

 src/app.c            |  6 ------
 src/gmrequest.c      |  6 ++++--
 src/gmutil.c         | 30 ++++++++++++++++++++++++++----
 src/gmutil.h         |  2 ++
 src/ui/inputwidget.c | 10 ++++++++--
 5 files changed, 40 insertions(+), 14 deletions(-)

=> Diff (Colored) | Diff (Colored, Plain Text) | 🔨 Patch

=> Parent cf0b3924 | Repository

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.10/commits/5e31f66313e2dc15fb9e75395504feb0992c3feb
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
65.977035 milliseconds
Gemini-to-HTML Time
0.808374 milliseconds

This content has been proxied by September (ba2dc).