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:
parent
f2216691f9
commit
b71eb0d49a
8 changed files with 77 additions and 42 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue