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:
parent
6b7fc6fdb5
commit
b94ce1485a
2 changed files with 26 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue