url: Don't treat slashes in query parameters as directory separators
Strip off query parameters from the original url before applying the new relative path. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a75b9a1804
commit
a6363e3d89
1 changed files with 7 additions and 1 deletions
|
@ -3389,7 +3389,7 @@ int ff_find_stream_index(AVFormatContext *s, int id)
|
||||||
void ff_make_absolute_url(char *buf, int size, const char *base,
|
void ff_make_absolute_url(char *buf, int size, const char *base,
|
||||||
const char *rel)
|
const char *rel)
|
||||||
{
|
{
|
||||||
char *sep;
|
char *sep, *path_query;
|
||||||
/* Absolute path, relative to the current server */
|
/* Absolute path, relative to the current server */
|
||||||
if (base && strstr(base, "://") && rel[0] == '/') {
|
if (base && strstr(base, "://") && rel[0] == '/') {
|
||||||
if (base != buf)
|
if (base != buf)
|
||||||
|
@ -3411,6 +3411,12 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
|
||||||
}
|
}
|
||||||
if (base != buf)
|
if (base != buf)
|
||||||
av_strlcpy(buf, base, size);
|
av_strlcpy(buf, base, size);
|
||||||
|
|
||||||
|
/* Strip off any query string from base */
|
||||||
|
path_query = strchr(buf, '?');
|
||||||
|
if (path_query != NULL)
|
||||||
|
*path_query = '\0';
|
||||||
|
|
||||||
/* Remove the file name from the base url */
|
/* Remove the file name from the base url */
|
||||||
sep = strrchr(buf, '/');
|
sep = strrchr(buf, '/');
|
||||||
if (sep)
|
if (sep)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue