From 9125f14468865f92092af85e1030069e102603ba Mon Sep 17 00:00:00 2001 From: Junfeng Qiao Date: Thu, 19 Dec 2024 16:49:18 +0100 Subject: [PATCH] Handle binary response as `octet-stream` --- src/server.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.jl b/src/server.jl index b5528fe..ba4e388 100644 --- a/src/server.jl +++ b/src/server.jl @@ -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()) =