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

Fix HTTP CORS bug when sending response for OPTIONS. 3.0.72

This commit is contained in:
winlin 2019-12-17 20:52:10 +08:00
parent ec0fb82c0e
commit dc1afc142f
8 changed files with 345 additions and 21 deletions

View file

@ -823,8 +823,6 @@ srs_error_t SrsHttpCorsMux::initialize(ISrsHttpServeMux* worker, bool cros_enabl
srs_error_t SrsHttpCorsMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
srs_error_t err = srs_success;
// If CORS enabled, and there is a "Origin" header, it's CORS.
if (enabled) {
SrsHttpHeader* h = r->header();
@ -848,9 +846,7 @@ srs_error_t SrsHttpCorsMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessag
} else {
w->write_header(SRS_CONSTS_HTTP_MethodNotAllowed);
}
if ((err = w->final_request()) != srs_success) {
return srs_error_wrap(err, "final request");
}
return w->final_request();
}
srs_assert(next);