Closed shark8me closed 6 years ago
In the examples/thingie/src/examples/thingie.clj, downloading a file fails as the following code
(GET "/file" [] :summary "file download" :return File :produces ["image/png"] (-> (io/resource "screenshot.png") (io/input-stream) (ok) (header "Content-Type" "image/png"))))
tries to json-encode the BufferedInputStream by default.
I've changed the example to add a call to disable-response-encoding, and added a separate test for the same.
disable-response-encoding
this is fixed in the latest Muuntaja & compojure-api 2.0.0 alpha - if a response has Content-Type header set, there will be no encoding, ever. Thanks for the PR, but closing this as resolved.
Content-Type
In the examples/thingie/src/examples/thingie.clj, downloading a file fails as the following code
tries to json-encode the BufferedInputStream by default.
I've changed the example to add a call to
disable-response-encoding
, and added a separate test for the same.