Skip to content

Commit

Permalink
This code appears to be completely unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Dec 2, 2012
1 parent 801ba44 commit 460ae21
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/twitter/request/multipart_with_file.rb
Expand Up @@ -3,17 +3,12 @@
module Twitter
module Request
class MultipartWithFile < Faraday::Middleware
CONTENT_TYPE = 'Content-Type'.freeze
class << self
attr_accessor :mime_type
mime_type = 'multipart/form-data'.freeze
end
CONTENT_TYPE = 'Content-Type'

def call(env)
env[:body].each do |key, value|
if value.respond_to?(:to_io)
env[:body][key] = Faraday::UploadIO.new(value, mime_type(value.path), value.path)
env[:request_headers][CONTENT_TYPE] = self.class.mime_type
end
end if env[:body].is_a?(::Hash)
@app.call(env)
Expand Down

0 comments on commit 460ae21

Please sign in to comment.