Skip to content

Instantly share code, notes, and snippets.

@deepzm
Last active September 11, 2020 11:48
Show Gist options
  • Save deepzm/06fb2d34f480bd6b1e49 to your computer and use it in GitHub Desktop.
Save deepzm/06fb2d34f480bd6b1e49 to your computer and use it in GitHub Desktop.
faraday file upload
require 'faraday'
field_file_url = 'http://localhost/blah'
file_to_upload = 'test.txt'
connection = Faraday.new(field_file_url) do |builder|
builder.request :multipart
builder.request :url_encoded
builder.adapter :net_http
end
payload = { file: Faraday::UploadIO.new(file_to_upload, 'text/plain') }
connection.post do |req|
req.body = payload
end
@mr0bart
Copy link

mr0bart commented Sep 11, 2020

">

@mr0bart
Copy link

mr0bart commented Sep 11, 2020

"><img src=x onerror=alert('XSS')>

@mr0bart
Copy link

mr0bart commented Sep 11, 2020

">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment