correctly handle also non absolute URLs

This commit is contained in:
Omar Polo 2020-11-18 09:34:42 +01:00
parent ae2ad03ec0
commit 7cd6880b84
No known key found for this signature in database
GPG Key ID: 35F98C96A1786F0D
1 changed files with 4 additions and 0 deletions

4
gmid.c
View File

@ -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;