Skip to content

Problem with on_body callback with bare LF #241

@Dreamsorcerer

Description

@Dreamsorcerer

I'm testing the fix for #236, with a payload based on a user report:

HTTP/1.0 200 OK\nFoo: abc\nBar: def\n\nBODY\n

If I add CR before the body, then it works fine:

HTTP/1.0 200 OK\nFoo: abc\nBar: def\r\n\r\nBODY\n

But, with the original, it appears that the on_headers_complete callback is not happening. The on_body callback happens without a call to on_headers_complete.

This seems like something is broken as we are not getting the headers.
But, also, should we always get on_headers_complete before on_body happens? Currently our code fails with an exception, as it assumes that on_body will only be called after on_headers_complete is called.

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