-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the request.body stream. Lazy-read to parse parameters rath…
…er than always setting RAW_POST_DATA. Reduces the memory footprint of large binary PUT requests. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6740 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
Showing
12 changed files
with
142 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
require 'action_controller/cgi_ext/stdinput' | ||
require 'action_controller/cgi_ext/parameters' | ||
require 'action_controller/cgi_ext/query_extension' | ||
require 'action_controller/cgi_ext/cookie' | ||
require 'action_controller/cgi_ext/session' | ||
|
||
class CGI #:nodoc: | ||
include ActionController::CgiExt::Stdinput | ||
include ActionController::CgiExt::Parameters | ||
|
||
class << self | ||
alias :escapeHTML_fail_on_nil :escapeHTML | ||
|
||
def escapeHTML(string) | ||
escapeHTML_fail_on_nil(string) unless string.nil? | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'cgi' | ||
|
||
module ActionController | ||
module CgiExt | ||
# Publicize the CGI's internal input stream so we can lazy-read | ||
# request.body. Make it writable so we don't have to play $stdin games. | ||
module Stdinput | ||
def self.included(base) | ||
base.class_eval do | ||
remove_method :stdinput | ||
attr_accessor :stdinput | ||
end | ||
|
||
base.alias_method_chain :initialize, :stdinput | ||
end | ||
|
||
def initialize_with_stdinput(type = nil, stdinput = $stdin) | ||
@stdinput = stdinput | ||
initialize_without_stdinput(type || 'query') | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.