yada

bradford 2018-05-04T19:36:25.000601Z

Hi! I'm having CORS problems. I think I'm doing it correctly? The browser says

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <https://backend.smoldercdn.com/clients/76361d62-daf3-49cc-b653-a6cc61d30e9b/users/e534e5b9-991b-4bcc-b195-0b4a86498a7c/emailcampaigns/?_=1525462328888>. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
and I'm accessing from http://localhost:9000

bradford 2018-05-04T19:36:49.000577Z

(def campaign-item-resource
  (yada/resource
   {:parameters {:path {:client_id String
                        :user_id String
                        :campaign_id String}}
    :produces   ["application/json"]
    :access-control {:allow-origin ["<http://smolder.com>" "<https://smolder.com>" "<http://localhost>" "<https://localhost>"
                                    "<https://www.smolder.com>" "<http://localhost:9000>"]
                     :allow-credentials true :allow-headers ["authorization" "accept" "accept-language" "connection" "content-type" "host" "if-none-match" "origin" "referer" "user-agent"]   :expose-headers #{"X-Custom"}}
    :methods
    {:get  {:response get-email-campaign}
     :put {:parameters {:body {:name String
                               :geo String
                               :autoaccept Boolean
                               :emails [String]}}
           :consumes   "application/json"
           :response   update-email-campaign}}}))

bradford 2018-05-04T19:38:24.000312Z

I also tried {:allow-origin "*" ... but got the same error

shooodooken 2018-05-04T22:45:14.000086Z

looking at the schema def for allow-origin here: https://github.com/juxt/yada/blob/f0f010548f7faacd9baa25c9eb7a14aafde0b424/src/yada/schema.clj#L345 ,try to put your domains in a set #{}