Skip to content

Allow passing a var to :access-control-allow-origin - #34

Open
dwwoelfel wants to merge 1 commit into
r0man:masterfrom
dwwoelfel:patch-1
Open

Allow passing a var to :access-control-allow-origin#34
dwwoelfel wants to merge 1 commit into
r0man:masterfrom
dwwoelfel:patch-1

Conversation

@dwwoelfel

Copy link
Copy Markdown

This allows you to pass a var as :access-control-allow-origin. It's nice in development because you can make changes to the function without having to restart the server.

Example:

(defn allow-origin? [req]
  (= (:uri req) "/my-cors-path"))
  
(wrap-cors handler :access-control-allow-origin #'allow-origin?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant