Skip to content

Commit

Permalink
Handle binary response as octet-stream (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojunfeng authored Jan 3, 2025
1 parent aa9266b commit f18935e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ end

server_response(resp::HTTP.Response) = resp
server_response(::Nothing) = server_response("")
server_response(ret::Vector{UInt8}) =
HTTP.Response(200, ["Content-Type" => "application/octet-stream"], body=ret)
server_response(ret) =
server_response(to_json(ret), [Pair("Content-Type", "application/json")])
server_response(resp::AbstractString, headers=HTTP.Headers()) =
Expand Down

0 comments on commit f18935e

Please sign in to comment.