Just to let everyone know that we've just released version 2.0 of encors,
with these suggested changes in place.
The middleware should now feel more Clojure-ish and Ring-ish :)
Thanks James for the great feedback.
On Wednesday, November 26, 2014 4:31:37 PM UTC-8, Román González wrote:
>
> Good
Good points...
So possible changes:
* Replace the get-policy-for-req argument with a just policy-options map
This makes it easier to validate options just once. I guess all the
validations done on a simple
Request -> CorsPolicy function can be done by composing middleware together
(e.g. Middlewa
On 26 November 2014 at 23:08, 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.
>
In Clojure, types a
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 namespa
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
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, wrote:
> It is our pleasure to
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 assertio