Class: Rack::Sanitizer::SanitizedRackInput
- Inherits:
-
Object
- Object
- Rack::Sanitizer::SanitizedRackInput
- Includes:
- Sanitizers
- Defined in:
- lib/rack/sanitizer.rb
Constant Summary collapse
- FailedToReadBody =
Class.new(Exception)
Instance Method Summary collapse
- #close ⇒ Object
- #each(&block) ⇒ Object
- #gets ⇒ Object
-
#initialize(original_io, env, uri_encoded, strategy) ⇒ SanitizedRackInput
constructor
A new instance of SanitizedRackInput.
- #read(*args) ⇒ Object
- #rewind ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(original_io, env, uri_encoded, strategy) ⇒ SanitizedRackInput
Returns a new instance of SanitizedRackInput.
219 220 221 222 223 224 225 |
# File 'lib/rack/sanitizer.rb', line 219 def initialize(original_io, env, uri_encoded, strategy) @original_io = original_io @uri_encoded = uri_encoded @env = env @strategy = strategy @sanitized_io = nil end |
Instance Method Details
#close ⇒ Object
248 249 250 251 |
# File 'lib/rack/sanitizer.rb', line 248 def close @sanitized_io&.close @original_io.close if @original_io.respond_to?(:close) end |
#each(&block) ⇒ Object
235 236 237 |
# File 'lib/rack/sanitizer.rb', line 235 def each(&block) sanitized_io.each(&block) end |
#gets ⇒ Object
227 228 229 |
# File 'lib/rack/sanitizer.rb', line 227 def gets sanitized_io.gets end |
#read(*args) ⇒ Object
231 232 233 |
# File 'lib/rack/sanitizer.rb', line 231 def read(*args) sanitized_io.read(*args) end |
#rewind ⇒ Object
239 240 241 |
# File 'lib/rack/sanitizer.rb', line 239 def rewind sanitized_io.rewind end |
#size ⇒ Object
243 244 245 246 |
# File 'lib/rack/sanitizer.rb', line 243 def size # StringIO#size is bytesize sanitized_io.size end |