metosin / compojure-api

Sweet web apis with Compojure & Swagger
http://metosin.github.io/compojure-api/doc/
Eclipse Public License 1.0
1.12k stars 149 forks source link

compojure.api.sweet/GET sets the Content-Type #378

Closed NOBLES5E closed 6 years ago

NOBLES5E commented 6 years ago

Library Version(s)

2.0.0-alpha19

Problem

Such an api will incorrectly set the Content-Type to text/html

       (api/GET "/owned-projects" []
         :return (s/spec boolean?)
         true)

which prohibits muuntaja setting the Content-Type to application/transit+json later.

POST does not have the same problem.

NOBLES5E commented 6 years ago

This is caused by not wrapping true in (http-response/ok true). Close.