Skip to content

Commit

Permalink
Must hack here to fix the multipart/form-data boundary number problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Jan 10, 2016
1 parent 16bb4c4 commit 5ddf470
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/wechat/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def post(path, payload, post_header = {})
def post_file(path, file, post_header = {})
request(path, post_header) do |url, header|
params = header.delete(:params)
HTTP.headers(header).post(url, params: params, form: { media: HTTP::FormData::File.new(file) }, ssl_context: ssl_context)
HTTP.headers(header)
.post(url, params: params,
form: { media: HTTP::FormData::File.new(file),
hack: 'X' }, # Existing here for http-form_data 1.0.1 handle single param improperly
ssl_context: ssl_context)
end
end

Expand Down

0 comments on commit 5ddf470

Please sign in to comment.