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

Fix bug when the value of http header is empty (#2888)

* Fix bug when the value of http header is empty

* add utest
This commit is contained in:
Haibo Chen 2022-02-03 15:05:09 +08:00 committed by GitHub
parent 6b7fc6fdb5
commit b94ce1485a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View file

@ -263,12 +263,12 @@ int SrsHttpParser::on_header_value(http_parser* parser, const char* at, size_t l
if (length > 0) {
obj->field_value.append(at, (int)length);
}
// When header parsed, we must save the position of start for body,
// because we have to consume the header in buffer.
// @see https://github.com/ossrs/srs/issues/1508
obj->p_header_tail = at;
// When header parsed, we must save the position of start for body,
// because we have to consume the header in buffer.
// @see https://github.com/ossrs/srs/issues/1508
obj->p_header_tail = at;
}
srs_info("Header value(%d bytes): %.*s", (int)length, (int)length, at);
return 0;