From 8864cc5aee3b134b0ffc5f53c1593645f4109f8c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 12 Dec 2020 12:39:21 +0200 Subject: Added option to show URL paths as encoded or decoded IssueID #73 --- src/gmrequest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gmrequest.c') diff --git a/src/gmrequest.c b/src/gmrequest.c index 991485bc..1f922142 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c @@ -482,8 +482,6 @@ void deinit_GmRequest(iGmRequest *d) { deinit_Gopher(&d->gopher); delete_Audience(d->finished); delete_Audience(d->updated); -// delete_GmResponse(d->respPub); -// deinit_GmResponse(&d->respInt); delete_GmResponse(d->resp); deinit_String(&d->url); delete_Mutex(d->mtx); @@ -494,6 +492,10 @@ void setUrl_GmRequest(iGmRequest *d, const iString *url) { /* Encode hostname to Punycode here because we want to submit the Punycode domain name in the request. (TODO: Pending possible Gemini spec change.) */ punyEncodeUrlHost_String(&d->url); + /* TODO: Gemini spec allows UTF-8 encoded URLs, but still need to percent-encode non-ASCII + characters? Could be a server-side issue, e.g., if they're using a URL parser meant for + the web. */ + urlEncodePath_String(&d->url); urlEncodeSpaces_String(&d->url); } -- cgit v1.2.3