Skip to content

Commit

Permalink
upnp: fix url handling when server provides absolute urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendi48 authored and BPanther committed Jul 6, 2023
1 parent 4294581 commit e3ca4a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/libupnpclient/UPNPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e3ca4a3

Please sign in to comment.