Class: Sunrise::FileUpload::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Sunrise::FileUpload::Request
- Defined in:
- lib/sunrise/file_upload/request.rb
Instance Method Summary collapse
Instance Method Details
#body ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/sunrise/file_upload/request.rb', line 16 def body if raw_post = @env['RAW_POST_DATA'] raw_post.force_encoding(Encoding::BINARY) if raw_post.respond_to?(:force_encoding) StringIO.new(raw_post) else @env['rack.input'] end end |
#raw_post ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/sunrise/file_upload/request.rb', line 8 def raw_post unless @env.include? 'RAW_POST_DATA' @env['RAW_POST_DATA'] = body.read(@env['CONTENT_LENGTH'].to_i) body.rewind if body.respond_to?(:rewind) end @env['RAW_POST_DATA'] end |