James, I have second thoughts on including map->CorsPolicy to the internal API...
Given that we are returning a Policy per request call, calling a map->CorsPolicy every time we call warp-cors sounds a bit overkill performance wise... Instead of validating development settings once when the namespaces is loaded, it is being validated every time a request comes in. I understand using map->CorsPolicy is not as Clojuresque, but I think we would prefer to enforce validity on development settings once than validate it each time just for the sake of keeping Clojure Map semantics. Does this make sense? Let me know your thoughts. Roman.- On Wed, Nov 26, 2014 at 3:08 PM, <ro...@unbounce.com> wrote: > map->CorsPolicy enforces correctness of input, this way the wrap-cors > functions doesn't need to validate data. Probably we can add a call to > map->CorsPolicy as the first thing of wrap-cors function and keep this > function private. > > Thanks for the suggestion. > > On Tuesday, November 25, 2014 5:27:12 PM UTC-8, James Reeves wrote: >> >> I mentioned this on r/clojure, but don't understand why you have a >> map->CorsPolicy function, as it doesn't appear to serve any purpose. You >> seem to be using it as a map, but in Clojure it's more idiomatic to use >> maps as maps. >> >> - James >> >> On 25 November 2014 at 23:40, <ro...@unbounce.com> wrote: >> >>> It is our pleasure to announce a new ring middleware for CORS support. >>> >>> https://github.com/unbounce/encors >>> >>> Features include: >>> >>> * Add multiple CORS Policy to an app (can classify them via ring request >>> info) >>> >>> * Preflight CORS requests are supported >>> >>> * Thoroughly tested (around 276 different assertions in both unit and >>> integration tests) >>> >>> * Validated API options via Prismatic's schema >>> >>> * Full documentation on README >>> >>> Any feedback is welcome. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clo...@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+u...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+u...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/GLFldAIjq7M/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.