From e3ca4a39d0b74a034f1824264e7cef35b509f429 Mon Sep 17 00:00:00 2001 From: Hendi48 <32822533+Hendi48@users.noreply.github.com> Date: Fri, 7 Jul 2023 01:11:41 +0200 Subject: [PATCH] upnp: fix url handling when server provides absolute urls --- lib/libupnpclient/UPNPDevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libupnpclient/UPNPDevice.cpp b/lib/libupnpclient/UPNPDevice.cpp index 8c01eef0d..6cdc09e38 100644 --- a/lib/libupnpclient/UPNPDevice.cpp +++ b/lib/libupnpclient/UPNPDevice.cpp @@ -320,6 +320,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; @@ -331,6 +333,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;