Skip to content

Bug: [redbean] Fetch() HTTP client ParseHttpMessage error on big headers #1315

@elitepleb

Description

@elitepleb

What happened?

Another Fetch() error that errors out on an input that is one longer than the previous.
In this case, 1286 writes Good!, 1287 writes Bad! and triggers an early exit in ParseHttpMessage
This broke an internal tool when updating to the 3.0 release.
As requests after authentication would fail, but only in specific cases.

.init.lua test case

function OnHttpRequest()
        if GetPath() == '/headers' then
                SetHeader('padding', string.rep('a',1287) )
                Write('Hello world!')
        else
                result = Fetch('http://127.0.0.1:8080/headers')
                if result then
                        Write('Good!')
                else
                        Write('Bad!')
                end
        end
end

Version

redbean releases after z0.0.43

What operating system are you seeing the problem on?

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    medium severityUsed to report medium severity bugs (e.g. Malfunctioning Features but still useable)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions