Last active
September 11, 2020 11:48
-
-
Save deepzm/06fb2d34f480bd6b1e49 to your computer and use it in GitHub Desktop.
faraday file upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
"><img src=x onerror=alert('XSS')>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
">