mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Add test for http status.
This commit is contained in:
parent
6ce04051e4
commit
4758a284d7
2 changed files with 10 additions and 6 deletions
|
@ -99,9 +99,9 @@ string srs_generate_http_status_text(int status)
|
|||
// permits a body. See RFC2616, section 4.4.
|
||||
bool srs_go_http_body_allowd(int status)
|
||||
{
|
||||
if (status >= 100 && status <= 199) {
|
||||
if (status >= SRS_CONSTS_HTTP_Continue && status < SRS_CONSTS_HTTP_OK) {
|
||||
return false;
|
||||
} else if (status == 204 || status == 304) {
|
||||
} else if (status == SRS_CONSTS_HTTP_NoContent || status == SRS_CONSTS_HTTP_NotModified) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -116,9 +116,7 @@ bool srs_go_http_body_allowd(int status)
|
|||
// returns "application/octet-stream".
|
||||
string srs_go_http_detect(char* data, int size)
|
||||
{
|
||||
// detect only when data specified.
|
||||
if (data) {
|
||||
}
|
||||
// TODO: Implement the content detecting.
|
||||
return "application/octet-stream"; // fallback
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue