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

Fix bug for HTTP write jsonp for srs-console.

This commit is contained in:
winlin 2019-12-24 10:32:52 +08:00
parent 40f6ecaee2
commit a35a7f915e
5 changed files with 52 additions and 21 deletions

View file

@ -699,7 +699,9 @@ srs_error_t SrsHttpResponseWriter::write(char* data, int size)
if (hdr->content_type().empty()) {
hdr->set_content_type("text/plain; charset=utf-8");
}
hdr->set_content_length(size);
if (hdr->content_length() == -1) {
hdr->set_content_length(size);
}
write_header(SRS_CONSTS_HTTP_OK);
}