From 89f72761853e2b16c896003c986b347721b2fdfd Mon Sep 17 00:00:00 2001 From: Hendi Date: Wed, 5 Jul 2023 18:52:41 +0200 Subject: [PATCH] upnp: fix url handling when server provides absolute urls This happens with Jellyfin and possibly other DLNA servers. --- lib/libupnpclient/UPNPDevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libupnpclient/UPNPDevice.cpp b/lib/libupnpclient/UPNPDevice.cpp index aa79534c2..dde2d64ab 100644 --- a/lib/libupnpclient/UPNPDevice.cpp +++ b/lib/libupnpclient/UPNPDevice.cpp @@ -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;