Fork me on GitHub

hi, i’m having a weird problem with compojure-api I have a simple route/api def

(GET "/authenticated" []
       :header-params [Authorization :- String]
       :auth-rules authenticated?
       :current-user user
       (ok ))
I’m sending a test request via swagger with a value filled in for Authorization in the form. But I’m getting a 400 and
  "errors": {
    "Authorization": "missing-required-key"
in the body. The header (with a JWS) is going over, it gets properly processed by buddy, but compojure-api seems to think my request is malformed or something
curl -X GET --header 'Accept: application/json' --header 'Authorization: Token eyJhbGciOiJSU….


does auth-rules dissoc the request map prior to compojure-api destructuring for the header-params?


FYI, something I just ran into using cloverage and custom metadata handlers. Easy to get wrong I think:


the header-params got that resolved via github issue. Ring lower-cases all header-keys.


hello everyone, is there a way to enable route-specific middleware? or at least api specific?


additional middleware fns can be added to the vector containing wrap-multipart-params


and i think you can also use the :middleware param in a (context ... form to apply it to a set of endpoints


this is superb! any docs showing the anatomy of a middleware?


a middleware function is a function that takes a handler and returns a function that takes a request