celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
596 stars 87 forks source link

Reel::RequestBody #75

Closed tarcieri closed 11 years ago

tarcieri commented 11 years ago

Encapsulate request bodies in their own object. This allows easy conversion to a string in cases where streaming isn't desired, or streaming as an IO-alike through #read and #readpartial

This is a breaking change from the previous API. People who were using request.body will now need to use request.body.to_s. The previous callback-based API for reading the body is completely removed.

/cc @adstage-david @raggi @halorgium

coveralls commented 11 years ago

Coverage Status

Coverage decreased (-0%) when pulling 76055f39febf4714fdd7d4ae6e118e4f70ddfa58 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 924576aa17a26ce84ac5ed97bf03ad665382dd16 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 0724c9b77b3e8a9951c48bc10c8d9e988a9e07a8 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 0724c9b77b3e8a9951c48bc10c8d9e988a9e07a8 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

coveralls commented 11 years ago

Coverage Status

Coverage decreased (-0%) when pulling 0724c9b77b3e8a9951c48bc10c8d9e988a9e07a8 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 0724c9b77b3e8a9951c48bc10c8d9e988a9e07a8 on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.

adstage-david commented 11 years ago

This looks good to me - getting rid of that callback for the body block is nice, that code felt kind of ugly.

tarcieri commented 11 years ago

There's a bug somewhere in this code. I'm getting RequestBody#readpartial returning an empty string for whatever reason, which it seems to be explicitly designed not to do.

Will continue investigating... and hopefully capture this case in a test

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 9ed107e4f476da616c73597db9085455a5ce937c on request-body-objects into f7eb96a3e70dc0dadde50567817c6a3b8689c544 on master.