Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode payload body based on message body Transfer-Encoding. #217

Closed
samoconnor opened this issue Mar 7, 2018 · 1 comment
Closed

Decode payload body based on message body Transfer-Encoding. #217

samoconnor opened this issue Mar 7, 2018 · 1 comment

Comments

@samoconnor
Copy link
Contributor

"The Transfer-Encoding header field lists the transfer coding names corresponding to the sequence of transfer codings that have been (or will be) applied to the payload body in order to form the message body."
https://tools.ietf.org/html/rfc7230#section-3.3.1

The Messages.payload function calls Messages.decode, but that function does not yet do anything:

HTTP.jl/src/Messages.jl

Lines 386 to 389 in b602c4e

function payload(m::Message)::Vector{UInt8}
enc = lowercase(first(split(header(m, "Transfer-Encoding"), ", ")))
return enc in ["", "identity", "chunked"] ? m.body : decode(m, enc)
end

HTTP.jl/src/Messages.jl

Lines 395 to 401 in b602c4e

function decode(m::Message, encoding::String)::Vector{UInt8}
if encoding == "gzip"
# Use https://github.com/bicycle1885/TranscodingStreams.jl ?
end
@warn "Decoding of HTTP Transfer-Encoding is not implemented yet!"
return m.body
end

@quinnj
Copy link
Member

quinnj commented Oct 9, 2020

Dup of #256

@quinnj quinnj closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants