summaryrefslogtreecommitdiff
path: root/src/gmrequest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r--src/gmrequest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c
index 884486b3..41b97620 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -491,6 +491,9 @@ void deinit_GmRequest(iGmRequest *d) {
491 491
492void setUrl_GmRequest(iGmRequest *d, const iString *url) { 492void setUrl_GmRequest(iGmRequest *d, const iString *url) {
493 set_String(&d->url, url); 493 set_String(&d->url, url);
494 /* Encode hostname to Punycode here because we want to submit the Punycode domain name
495 in the request. (TODO: Pending possible Gemini spec change.) */
496 punyEncodeUrlHost_String(&d->url);
494 urlEncodeSpaces_String(&d->url); 497 urlEncodeSpaces_String(&d->url);
495} 498}
496 499
@@ -646,7 +649,7 @@ void submit_GmRequest(iGmRequest *d) {
646 if (port == 0) { 649 if (port == 0) {
647 port = 1965; /* default Gemini port */ 650 port = 1965; /* default Gemini port */
648 } 651 }
649 setUrl_TlsRequest(d->req, host, port); 652 setHost_TlsRequest(d->req, host, port);
650 setContent_TlsRequest(d->req, 653 setContent_TlsRequest(d->req,
651 utf8_String(collectNewFormat_String("%s\r\n", cstr_String(&d->url)))); 654 utf8_String(collectNewFormat_String("%s\r\n", cstr_String(&d->url))));
652 submit_TlsRequest(d->req); 655 submit_TlsRequest(d->req);