Skip to content

Content-Length should be ignored for 304 responses #244

@guoye-zhang

Description

@guoye-zhang

Responses with 304 status code have no body even if it contains a non-zero Content-Length header.

https://www.rfc-editor.org/rfc/rfc9112.html#section-6.3-2.1

Parts of llhttp_message_needs_eof should run before the parser->flags & F_CONTENT_LENGTH check:

llhttp/src/native/http.c

Lines 77 to 78 in 926c982

if (!(parser->flags & F_CONTENT_LENGTH)) {
if (!llhttp_message_needs_eof(parser)) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions