Skip to content

Commit

Permalink
payload fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 18, 2018
1 parent 57ff747 commit 17b8cd7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,11 @@ end
load(m::Message) = payload(m, String)

payload(m::Message)::Vector{UInt8} =
(enc = hasheader(m, "Transfer-Encoding")) != "" ? decode(m, enc) : m.body
(enc = header(m, "Transfer-Encoding")) != "" ? decode(m, enc) : m.body

payload(m::Message, ::Type{String}) =
hasheader(m, "Content-Type", "ISO-8859-1") ?
iso8859_1_to_utf8(payload(m)) :
String(payload(m))
hasheader(m, "Content-Type", "ISO-8859-1") ? iso8859_1_to_utf8(payload(m)) :
String(payload(m))

function decode(m::Message, encoding::String)::Vector{UInt8}
@warn "Decoding of HTTP Transfer-Encoding is not implemented yet!"
Expand Down

0 comments on commit 17b8cd7

Please sign in to comment.