You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I can tell, this would also work to support responses if we loosened the type restriction on the parameter to HTTP.Message instead of just HTTP.Request. This is what we've done in our own code, and it's been working well:
# Same as HTTP.parse_multipart_form, but this works on both requests and responses as# opposed to only requests.#TODO: we should probably PR this to HTTP.jlfunction_parse_multipart_form(msg::HTTP.Message)
# parse boundary from Content-Type
m =match(r"multipart/form-data; boundary=(.*)$", msg["Content-Type"])
m ===nothing&&returnnothing
boundary_delimiter = m[1]
# [RFC2046 5.1.1](https://tools.ietf.org/html/rfc2046#section-5.1.1)length(boundary_delimiter) >70&&error("boundary delimiter must not be greater than 70 characters")
return HTTP.MultiPartParsing.parse_multipart_body(HTTP.payload(msg), boundary_delimiter)
end
This is me making good on this "TODO" 😁 Does a PR like that sound okay?
The text was updated successfully, but these errors were encountered:
(As of HTTP v0.9.17; Julia v1.7.2)
We currently support parsing a multi-part request, but don't support parsing a multi-part response. Here's the multi-part request parsing code:
HTTP.jl/src/parsemultipart.jl
Lines 235 to 246 in 6c0f645
From what I can tell, this would also work to support responses if we loosened the type restriction on the parameter to
HTTP.Message
instead of justHTTP.Request
. This is what we've done in our own code, and it's been working well:This is me making good on this "TODO" 😁 Does a PR like that sound okay?
The text was updated successfully, but these errors were encountered: