Commit 33893e6a authored by Duncan Salerno's avatar Duncan Salerno Committed by Martin Storsjö

url: Handle relative urls starting with two slashes

This is defined by RFC 3986 section 5.4.1 to be handled this way.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent eea00381
...@@ -3396,11 +3396,17 @@ void ff_make_absolute_url(char *buf, int size, const char *base, ...@@ -3396,11 +3396,17 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
av_strlcpy(buf, base, size); av_strlcpy(buf, base, size);
sep = strstr(buf, "://"); sep = strstr(buf, "://");
if (sep) { if (sep) {
/* Take scheme from base url */
if (rel[1] == '/') {
sep[1] = '\0';
} else {
/* Take scheme and host from base url */
sep += 3; sep += 3;
sep = strchr(sep, '/'); sep = strchr(sep, '/');
if (sep) if (sep)
*sep = '\0'; *sep = '\0';
} }
}
av_strlcat(buf, rel, size); av_strlcat(buf, rel, size);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment