Skip to content

Commit

Permalink
Merge pull request #63 from stask/master
Browse files Browse the repository at this point in the history
fix CORS with credentials
  • Loading branch information
niwinz authored Apr 25, 2017
2 parents 635e1df + 22b8265 commit f6c5c44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/clojure/catacumba/handlers/misc.clj
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@
(hs/send! context "")))

(defn- handle-response
[context headers {:keys [allow-headers expose-headers origin] :as opts}]
[context headers {:keys [allow-headers expose-headers origin allow-credentials] :as opts}]
(let [^String origin (get headers :origin)]
(when-let [origin (allow-origin? origin opts)]
(ct/set-headers! context {:access-control-allow-origin origin})
(when allow-credentials
(ct/set-headers! context {:access-control-allow-credentials true}))
(when allow-headers
(ct/set-headers! context {:access-control-allow-headers (normalize-headers allow-headers)}))
(when expose-headers
Expand Down Expand Up @@ -173,4 +175,3 @@
(reify Block
(^void execute [_]
(.next ctx)))))))

0 comments on commit f6c5c44

Please sign in to comment.