|
Revision 6740, 0.6 kB
(checked in by bitsweat, 2 years ago)
|
Introduce the request.body stream. Lazy-read to parse parameters rather than always setting RAW_POST_DATA. Reduces the memory footprint of large binary PUT requests.
|
| Line | |
|---|
| 1 |
require 'cgi' |
|---|
| 2 |
|
|---|
| 3 |
module ActionController |
|---|
| 4 |
module CgiExt |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
module Stdinput |
|---|
| 8 |
def self.included(base) |
|---|
| 9 |
base.class_eval do |
|---|
| 10 |
remove_method :stdinput |
|---|
| 11 |
attr_accessor :stdinput |
|---|
| 12 |
end |
|---|
| 13 |
|
|---|
| 14 |
base.alias_method_chain :initialize, :stdinput |
|---|
| 15 |
end |
|---|
| 16 |
|
|---|
| 17 |
def initialize_with_stdinput(type = nil, stdinput = $stdin) |
|---|
| 18 |
@stdinput = stdinput |
|---|
| 19 |
initialize_without_stdinput(type || 'query') |
|---|
| 20 |
end |
|---|
| 21 |
end |
|---|
| 22 |
end |
|---|
| 23 |
end |
|---|