diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 19:47:26 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 19:47:26 +0300 |
commit | eec0212cbd8b984de17de07d4bae1be2c1720f41 (patch) | |
tree | 8ea465a8f85b216af3895582162017f677e16b9a /src/gmutil.c | |
parent | 8386f43c5ba48fac44332b90160f6fa4c6f14799 (diff) |
Append a slash in absolute URLs without a path
Saves a redirect.
Diffstat (limited to 'src/gmutil.c')
-rw-r--r-- | src/gmutil.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
155 | } | 155 | } |
156 | } | 156 | } |
157 | if (isDef_(rel.scheme) || isDef_(rel.host) || startsWith_Rangecc(rel.path, "/")) { | 157 | if (isDef_(rel.scheme) || isDef_(rel.host) || startsWith_Rangecc(rel.path, "/")) { |
158 | appendRange_String(absolute, rel.path); /* absolute path */ | 158 | appendRange_String(absolute, isDef_(rel.path) ? rel.path : range_CStr("/")); /* absolute path */ |
159 | } | 159 | } |
160 | else { | 160 | else { |
161 | if (!endsWith_Rangecc(orig.path, "/")) { | 161 | if (!endsWith_Rangecc(orig.path, "/")) { |