mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
multipart form: skip parts where value is nil
This commit is contained in:
parent
b8745bb3cc
commit
af8539a7a7
@ -49,6 +49,8 @@ module HTTPX::Plugins
|
|||||||
@bytesize = 0
|
@bytesize = 0
|
||||||
params = form.each_with_object([]) do |(key, val), aux|
|
params = form.each_with_object([]) do |(key, val), aux|
|
||||||
Multipart.normalize_keys(key, val) do |k, v|
|
Multipart.normalize_keys(key, val) do |k, v|
|
||||||
|
next if v.nil?
|
||||||
|
|
||||||
value, content_type, filename = Part.call(v)
|
value, content_type, filename = Part.call(v)
|
||||||
|
|
||||||
header = header_part(k, content_type, filename)
|
header = header_part(k, content_type, filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user