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

support more splash in http url. remove the strip of SrsRequest, use srs_string_remove instead, change to 0.9.44

This commit is contained in:
winlin 2014-04-03 15:53:56 +08:00
parent f2216691f9
commit b71eb0d49a
8 changed files with 77 additions and 42 deletions

View file

@ -338,7 +338,20 @@ void SrsHttpMessage::reset()
int SrsHttpMessage::parse_uri()
{
return _uri->initialize(_url);
// filter url according to HTTP specification.
// remove the duplicated slash.
std::string filtered_url = srs_string_replace(_url, "//", "/");
// remove the last / to match resource.
filtered_url = srs_string_trim_end(filtered_url, "/");
// if empty, use root.
if (filtered_url.empty()) {
filtered_url = "/";
}
return _uri->initialize(filtered_url);
}
bool SrsHttpMessage::is_complete()