You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
applehttp: Handle absolute paths relative to the current server
This fixes roundup issue 2583. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
committed by
Ronald S. Bultje
parent
5306bf41a6
commit
185a155e57
@@ -90,6 +90,20 @@ static void make_absolute_url(char *buf, int size, const char *base,
|
|||||||
const char *rel)
|
const char *rel)
|
||||||
{
|
{
|
||||||
char *sep;
|
char *sep;
|
||||||
|
/* Absolute path, relative to the current server */
|
||||||
|
if (base && strstr(base, "://") && rel[0] == '/') {
|
||||||
|
if (base != buf)
|
||||||
|
av_strlcpy(buf, base, size);
|
||||||
|
sep = strstr(buf, "://");
|
||||||
|
if (sep) {
|
||||||
|
sep += 3;
|
||||||
|
sep = strchr(sep, '/');
|
||||||
|
if (sep)
|
||||||
|
*sep = '\0';
|
||||||
|
}
|
||||||
|
av_strlcat(buf, rel, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* If rel actually is an absolute url, just copy it */
|
/* If rel actually is an absolute url, just copy it */
|
||||||
if (!base || strstr(rel, "://") || rel[0] == '/') {
|
if (!base || strstr(rel, "://") || rel[0] == '/') {
|
||||||
av_strlcpy(buf, rel, size);
|
av_strlcpy(buf, rel, size);
|
||||||
|
Reference in New Issue
Block a user