Skip to content

Commit

Permalink
Merge pull request #6 from ursm/mime
Browse files Browse the repository at this point in the history
Fix Content-Type detection
  • Loading branch information
ursm committed Jul 7, 2024
2 parents 9e65e96 + 9b00e60 commit dfd2ca7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fetch/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def fetch(resource, method: :get, headers: [], body: nil, redirect: :follow, _re
if v.is_a?(File)
[k, v, {
filename: File.basename(v.path),
content_type: Marcel::MimeType.for(v) || 'application/octet-stream'
content_type: Marcel::MimeType.for(name: v.path)
}]
else
[k, v]
Expand Down
2 changes: 1 addition & 1 deletion spec/fetch/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
Alice
NAME
Content-Disposition: form-data; name="file"; filename="foo.txt"
Content-Type: application/octet-stream
Content-Type: text/plain
bar
FILE
Expand Down

0 comments on commit dfd2ca7

Please sign in to comment.