Merge branch 'fix-filemagic'

This commit is contained in:
HoneyryderChuck 2022-01-12 10:11:50 +02:00
commit f99abc38e2
4 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,5 @@
# 0.18.6
## Bugfixes
* multipart plugin: fixed missing constant in `filemagic` integration.

View File

@ -9,6 +9,8 @@ module HTTPX
# inspired by https://github.com/shrinerb/shrine/blob/master/lib/shrine/plugins/determine_mime_type.rb
if defined?(FileMagic)
MAGIC_NUMBER = 256 * 1024
def call(file, _)
return nil if file.eof? # FileMagic returns "application/x-empty" for empty files

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module HTTPX
VERSION = "0.18.5"
VERSION = "0.18.6"
end

View File

@ -1,4 +1,7 @@
-
-
name: "0.18.6"
path: "0_18_6_md.html"
-
name: "0.18.5"
path: "0_18_5_md.html"