1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Improve test coverage for protocols.

This commit is contained in:
winlin 2019-12-18 21:18:11 +08:00
parent bf92172e62
commit 25f132ec2f
3 changed files with 363 additions and 140 deletions

View file

@ -76,9 +76,6 @@ void srs_vhost_resolve(string& vhost, string& app, string& param)
if (!query.empty()) {
vhost = query;
}
if ((pos = vhost.find("?")) != std::string::npos) {
vhost = vhost.substr(0, pos);
}
}
}
@ -199,7 +196,7 @@ string srs_generate_stream_with_query(string host, string vhost, string stream,
}
// Remove the start & when param is empty.
srs_string_trim_start(query, "&");
query = srs_string_trim_start(query, "&");
// Prefix query with ?.
if (!query.empty() && !srs_string_starts_with(query, "?")) {