summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-07-01 07:34:34 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-07-01 07:34:34 +0300
commitb264791f65730b5e6c2414415cc4f4f1cb9253d8 (patch)
treee8a7a6bad592ad67aa0e9df1c2f22713e7720e35 /src
parent646dfccf647967c780e7470dfd7349c71a6ebac7 (diff)
Using Canonical URLs
Diffstat (limited to 'src')
-rw-r--r--src/gmdocument.c2
-rw-r--r--src/gmrequest.c2
-rw-r--r--src/ui/documentwidget.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 8832271a..c298f75b 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -181,7 +181,7 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li
181 iGmLink *link = new_GmLink(); 181 iGmLink *link = new_GmLink();
182 link->urlRange = capturedRange_RegExpMatch(&m, 1); 182 link->urlRange = capturedRange_RegExpMatch(&m, 1);
183 setRange_String(&link->url, link->urlRange); 183 setRange_String(&link->url, link->urlRange);
184 set_String(&link->url, absoluteUrl_String(&d->url, &link->url)); 184 set_String(&link->url, canonicalUrl_String(absoluteUrl_String(&d->url, &link->url)));
185 /* Check the URL. */ { 185 /* Check the URL. */ {
186 iUrl parts; 186 iUrl parts;
187 init_Url(&parts, &link->url); 187 init_Url(&parts, &link->url);
diff --git a/src/gmrequest.c b/src/gmrequest.c
index 1325c025..672614a2 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -526,7 +526,7 @@ void enableFilters_GmRequest(iGmRequest *d, iBool enable) {
526} 526}
527 527
528void setUrl_GmRequest(iGmRequest *d, const iString *url) { 528void setUrl_GmRequest(iGmRequest *d, const iString *url) {
529 set_String(&d->url, urlFragmentStripped_String(url)); 529 set_String(&d->url, canonicalUrl_String(urlFragmentStripped_String(url)));
530 /* Encode hostname to Punycode here because we want to submit the Punycode domain name 530 /* Encode hostname to Punycode here because we want to submit the Punycode domain name
531 in the request. (TODO: Pending possible Gemini spec change.) */ 531 in the request. (TODO: Pending possible Gemini spec change.) */
532 punyEncodeUrlHost_String(&d->url); 532 punyEncodeUrlHost_String(&d->url);
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 509933af..6a2173af 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1638,7 +1638,7 @@ static void updateFromCachedResponse_DocumentWidget_(iDocumentWidget *d, float n
1638} 1638}
1639 1639
1640static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { 1640static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) {
1641 const iRecentUrl *recent = findUrl_History(d->mod.history, canonicalUrl_String(d->mod.url)); 1641 const iRecentUrl *recent = findUrl_History(d->mod.history, d->mod.url);
1642 if (recent && recent->cachedResponse) { 1642 if (recent && recent->cachedResponse) {
1643 iChangeFlags(d->flags, 1643 iChangeFlags(d->flags,
1644 openedFromSidebar_DocumentWidgetFlag, 1644 openedFromSidebar_DocumentWidgetFlag,