From eec0212cbd8b984de17de07d4bae1be2c1720f41 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 Aug 2020 19:47:26 +0300 Subject: Append a slash in absolute URLs without a path Saves a redirect. --- src/gmutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gmutil.c') diff --git a/src/gmutil.c b/src/gmutil.c index ed3e7218..07bf3016 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -155,7 +155,7 @@ const iString *absoluteUrl_String(const iString *d, const iString *urlMaybeRelat } } if (isDef_(rel.scheme) || isDef_(rel.host) || startsWith_Rangecc(rel.path, "/")) { - appendRange_String(absolute, rel.path); /* absolute path */ + appendRange_String(absolute, isDef_(rel.path) ? rel.path : range_CStr("/")); /* absolute path */ } else { if (!endsWith_Rangecc(orig.path, "/")) { -- cgit v1.2.3