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

check 'vhost' validity in 'http raw dvr api' (#2435)

This commit is contained in:
Xiaoniu 2021-06-28 07:51:57 +08:00 committed by GitHub
parent d02ba80db1
commit f986b5956b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -1206,7 +1206,12 @@ srs_error_t SrsGoApiRaw::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage*
if (action != "enable" && action != "disable") {
return srs_api_response_code(w, r, ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED);
}
// the vhost must exists.
if (!_srs_config->get_vhost(value, false)) {
return srs_api_response_code(w, r, ERROR_SYSTEM_CONFIG_RAW_PARAMS);
}
if (!_srs_config->get_dvr_enabled(value)) {
return srs_api_response_code(w, r, ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED);
}