From d52f3dfa2f81c9520b8ff1fdfe4adeac3907a7a4 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 11 Jan 2021 08:29:52 +0200 Subject: Omit default Gemini port from URLs Including the default port number is redundant. Normalize to a port-less URL. --- src/gmutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gmutil.c') 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 iString *decHost = punyDecodeHost_(selHost->host); append_String(absolute, decHost); delete_String(decHost); - if (!isEmpty_Range(&selHost->port)) { + /* Default Gemini port is removed as redundant; normalization. */ + if (!isEmpty_Range(&selHost->port) && (!equalCase_Rangecc(scheme, "gemini") + || !equal_Rangecc(selHost->port, "1965"))) { appendCStr_String(absolute, ":"); appendRange_String(absolute, selHost->port); } -- cgit v1.2.3