Skip to content

Falcon and protocol body rewind #310

@tleish

Description

@tleish

We are currently using an older version of Falcon 0.42.3 (working on upgrading code to Ruby 3 soon) and using the ruby Grape API library. Grape calls input.read and then input.rewind, however if attempting to read again then the body is empty

see: https://github.com/ruby-grape/grape/blob/master/lib/grape/middleware/formatter.rb#L67-L79

I noticed that the body is Protocol::HTTP1::Body::Fixed which does not support rewind, but the Protocol::HTTP does support rewind. Debugging this a little, it appears falcon chooses the protocol on startup. It's not clear to me how falcon decided which protocol to use (at startup) and if it's possible to configure to use a different one that supports rewind.

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