Path component in URI is optional

This commit is contained in:
badaix 2019-11-27 22:59:12 +01:00
parent a625a5d806
commit 40c910104b

View file

@ -64,7 +64,12 @@ void StreamUri::parse(const std::string& streamUri)
pos = tmp.find('/');
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));
tmp = tmp.substr(pos);
path = tmp;