upnp: fix url handling when server provides absolute urls

This happens with Jellyfin and possibly other DLNA servers.
This commit is contained in:
Hendi
2023-07-05 18:52:41 +02:00
parent 1fddc13fbb
commit 89f7276185

View File

@@ -317,6 +317,8 @@ CUPnPDevice::CUPnPDevice(std::string url)
eurl=urlbase + "/";
else if (p[0]=='/')
eurl=urlbase + std::string(p);
else if (!strncmp(p, "http", 4))
eurl=std::string(p);
else
eurl=urlbase + "/" + std::string(p);
founde = true;
@@ -328,6 +330,8 @@ CUPnPDevice::CUPnPDevice(std::string url)
curl=urlbase + "/";
else if (p[0]=='/')
curl=urlbase + std::string(p);
else if (!strncmp(p, "http", 4))
curl=std::string(p);
else
curl=urlbase + "/" + std::string(p);
foundc = true;