diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-11 08:29:52 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-11 08:29:52 +0200 |
commit | d52f3dfa2f81c9520b8ff1fdfe4adeac3907a7a4 (patch) | |
tree | dfbf16a795ded04b28b0b03fc9689e076bad623b /src | |
parent | a3a89bd8cf269953d3c41cfc9bf5e76caffe1866 (diff) |
Omit default Gemini port from URLs
Including the default port number is redundant. Normalize to a port-less URL.
Diffstat (limited to 'src')
-rw-r--r-- | src/gmutil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gmutil.c b/src/gmutil.c index cf96cfd8..a299347f 100644 --- a/src/gmutil.c +++ b/src/gmutil.c | |||
@@ -213,7 +213,9 @@ const iString *absoluteUrl_String(const iString *d, const iString *urlMaybeRelat | |||
213 | iString *decHost = punyDecodeHost_(selHost->host); | 213 | iString *decHost = punyDecodeHost_(selHost->host); |
214 | append_String(absolute, decHost); | 214 | append_String(absolute, decHost); |
215 | delete_String(decHost); | 215 | delete_String(decHost); |
216 | if (!isEmpty_Range(&selHost->port)) { | 216 | /* Default Gemini port is removed as redundant; normalization. */ |
217 | if (!isEmpty_Range(&selHost->port) && (!equalCase_Rangecc(scheme, "gemini") | ||
218 | || !equal_Rangecc(selHost->port, "1965"))) { | ||
217 | appendCStr_String(absolute, ":"); | 219 | appendCStr_String(absolute, ":"); |
218 | appendRange_String(absolute, selHost->port); | 220 | appendRange_String(absolute, selHost->port); |
219 | } | 221 | } |