mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-31 01:46:16 +02:00
Path component in URI is optional
This commit is contained in:
parent
a625a5d806
commit
40c910104b
1 changed files with 6 additions and 1 deletions
|
@ -64,7 +64,12 @@ void StreamUri::parse(const std::string& streamUri)
|
||||||
|
|
||||||
pos = tmp.find('/');
|
pos = tmp.find('/');
|
||||||
if (pos == string::npos)
|
if (pos == string::npos)
|
||||||
throw invalid_argument("missing path separator: '/'");
|
{
|
||||||
|
pos = tmp.find('?');
|
||||||
|
if (pos == string::npos)
|
||||||
|
pos = tmp.length();
|
||||||
|
}
|
||||||
|
|
||||||
host = strutils::trim_copy(tmp.substr(0, pos));
|
host = strutils::trim_copy(tmp.substr(0, pos));
|
||||||
tmp = tmp.substr(pos);
|
tmp = tmp.substr(pos);
|
||||||
path = tmp;
|
path = tmp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue