Skip to content

Commit

Permalink
Merge pull request #181 from mechiland/master
Browse files Browse the repository at this point in the history
Fix #179 & #180
  • Loading branch information
Eric-Guo authored Mar 17, 2017
2 parents 6741a58 + 03ac338 commit 93bdf5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/wechat/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def post(path, payload, post_header = {})
def post_file(path, file, post_header = {})
request(path, post_header) do |url, header|
params = header.delete(:params)
form_file = file.is_a?(HTTP::FormData::File) ? file : HTTP::FormData::File.new(file)
httprb.headers(header)
.post(url, params: params,
form: { media: HTTP::FormData::File.new(file),
form: { media: form_file,
hack: 'X' }, # Existing here for http-form_data 1.0.1 handle single param improperly
ssl_context: ssl_context)
end
Expand Down
2 changes: 1 addition & 1 deletion wechat.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.cert_chain = ['certs/Eric-Guo.pem']
s.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')

s.add_runtime_dependency 'activesupport', '>= 3.2', '< 5.1.x'
s.add_runtime_dependency 'activesupport', '>= 3.2', '<= 5.2'
s.add_runtime_dependency 'nokogiri', '>=1.6.0'
s.add_runtime_dependency 'thor'
s.add_runtime_dependency 'http', '>= 1.0.4', '< 3'
Expand Down

0 comments on commit 93bdf5f

Please sign in to comment.