1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

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: Martin Storsjö <martin@martin.st>
This commit is contained in:
Duncan Salerno
2012-10-06 02:02:18 +03:00
committed by Martin Storsjö
parent eea003814c
commit 33893e6abc

View File

@@ -3396,10 +3396,16 @@ 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) {
sep += 3; /* Take scheme from base url */
sep = strchr(sep, '/'); if (rel[1] == '/') {
if (sep) sep[1] = '\0';
*sep = '\0'; } else {
/* Take scheme and host from base url */
sep += 3;
sep = strchr(sep, '/');
if (sep)
*sep = '\0';
}
} }
av_strlcat(buf, rel, size); av_strlcat(buf, rel, size);
return; return;