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

support http error code, check url

This commit is contained in:
winlin 2014-04-03 15:17:02 +08:00
parent 0ae23d7556
commit 818c1f1520
5 changed files with 172 additions and 0 deletions

View file

@ -44,6 +44,21 @@ SrsApiRoot::~SrsApiRoot()
{
}
bool SrsApiRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase)
{
if (!SrsHttpHandler::is_handler_valid(req, status_code, reason_phrase)) {
return false;
}
if (req->match()->matched_url.length() != 1) {
status_code = HTTP_NotFound;
reason_phrase = HTTP_NotFound_str;
return false;
}
return true;
}
bool SrsApiRoot::can_handle(const char* path, int length, const char** pchild)
{
// reset the child path to path,