aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2020-11-18 09:34:42 +0100
committerOmar Polo <op@omarpolo.com>2020-11-18 09:34:42 +0100
commit7cd6880b84f3bba0cc8b11ef452dba18e0b51155 (patch)
treebd88990953b9db6db431e522ad605c3f7b08ec52
parentae2ad03ec0ae5f2300472239eb48f3e23d467fe2 (diff)
correctly handle also non absolute URLs
-rw-r--r--gmid.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gmid.c b/gmid.c
index d0f03a7..7233754 100644
--- a/gmid.c
+++ b/gmid.c
@@ -202,6 +202,10 @@ url_start_of_request(char *url)
if ((s = url_after_proto(url)) == NULL)
return NULL;
+ /* non-absolute URL */
+ if (s == url)
+ return s;
+
if ((t = strstr(s, "/")) == NULL)
return s + strlen(s);
return t;