Skip to content

Commit

Permalink
Merge pull request #953 from appwrite/fix-ruby-create-deployment
Browse files Browse the repository at this point in the history
fix: ruby create deployment
  • Loading branch information
christyjacob4 authored Aug 21, 2024
2 parents c92942d + 7cf11f3 commit 1130d02
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions templates/ruby/lib/container/client.rb.twig
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ module {{ spec.title | caseUcfirst }}
when 'application/json'
payload = params.to_json
when 'multipart/form-data'
payload = "--#{@boundary}\r\n" + encode_form_data(params)
payload = encode_form_data(params) + "--#{@boundary}--\r\n"
headers[:'content-type'] = "multipart/form-data; boundary=#{@boundary}"
else
payload = encode(params)
Expand Down Expand Up @@ -284,16 +284,18 @@ module {{ spec.title | caseUcfirst }}
else
post_body = []
if value.instance_of? InputFile
post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\"\r\n"
post_body << "Content-Type: #{value.mime_type}\r\n\r\n"
post_body << "--#{@boundary}"
post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\""
post_body << "Content-Type: #{value.mime_type}"
post_body << ""
post_body << value.data
post_body << "\r\n--#{@boundary}--\r\n"
else
post_body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
post_body << "#{value.to_s}"
post_body << "\r\n--#{@boundary}\r\n"
else
post_body << "--#{@boundary}"
post_body << "Content-Disposition: form-data; name=\"#{key}\""
post_body << ""
post_body << value.to_s
end
post_body.join
post_body.join("\r\n") + "\r\n"
end
end

Expand Down

0 comments on commit 1130d02

Please sign in to comment.