Project

General

Profile

Actions

Feature #8155

closed

Improve support for streaming responses in WEBrick

Added by drbrain (Eric Hodel) about 11 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
[ruby-core:53665]

Description

Currently WEBrick only understands a body that is a String or an IO. This makes it difficult to stream a response body. Instead of providing a body that duck-types to IO you must use IO.pipe which can be clumsy.

The attached patch checks if the body responds to #readpartial (#read is assumed) instead of if it is an instance of class IO.


Files

webrick.httpresponse.stringio.patch (2.36 KB) webrick.httpresponse.stringio.patch drbrain (Eric Hodel), 03/23/2013 05:00 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0