Re: [akka-user] Re: CORS Support Akka-http

2016-07-14 Thread Konrad Malawski
Use the community provided ones. There's no need for us to ship one if community has stepped up and provided libraries, as is the case here I believe :-) -- Konrad `ktoso` Malawski Akka @ Lightbend On 14 July 2016 at 15:26:04, Matan Safriel

Re: [akka-user] Re: CORS Support Akka-http

2016-07-14 Thread Matan Safriel
Any built-in support for CORS by now? On Friday, September 25, 2015 at 5:20:07 PM UTC+3, Patrik Nordwall wrote: > > Thanks for sharing, Patrick. > > On Tue, Sep 22, 2015 at 1:42 PM, Patrick Ting > wrote: > >> Hi Everyone, >> >> I ended up porting and modifying Ganta's

Re: [akka-user] Re: CORS Support Akka-http

2016-06-18 Thread Fiona Boyle
Thank you for the quick reply. I will try this out. Best wishes Fiona On 17 June 2016 at 20:53, Lomig Mégard wrote: > Hi Fiona, > > The simplest way to enable CORS with akka-http is to use the > akka-http-cors library: > https://github.com/lomigmegard/akka-http-cors >

Re: [akka-user] Re: CORS Support Akka-http

2016-06-17 Thread Lomig Mégard
Hi Fiona, The simplest way to enable CORS with akka-http is to use the akka-http-cors library: https://github.com/lomigmegard/akka-http-cors Look at the README for some basic examples. You can change the default settings, including the allowed origins. val settings =

Re: [akka-user] Re: CORS Support Akka-http

2016-06-17 Thread Fiona Boyle
Thank you to everyone who ask been answering these questions. I am trying to implement CORS support in Akka Http, but I am not sure how to specify any origin. The code above uses val sAllowedOrigin = config.getString("cors.allowed-origin") but I cannot find out what should be in this string

Re: [akka-user] Re: CORS Support Akka-http

2016-03-19 Thread Lomig Mégard
Hi, Jumping in this thread to share the akka-http CORS implementation I have been working on recently: https://github.com/lomigmegard/akka-http-cors The goal was to follow the recommendation from W3C (https://www.w3.org/TR/cors/) and be still easy to use. Not production ready as I would

Re: [akka-user] Re: CORS Support Akka-http

2016-03-18 Thread Konrad Malawski
Thanks for sharing Lomig! I only skimmed through so far but looks very good already! I've added it to my board of things to look at in detail, it's a bit long but I hope to get there eventually!  You can also add it to the akka.io/community page so people can find it from there :-) (We aim to

Re: [akka-user] Re: CORS Support Akka-http

2016-02-03 Thread tdrozdowski
Seems like as of akka-http 2.0.3 the pre-flight OPTIONS handling via RejectionHandler no longer works as expected - at least if you're trying to use the directive once to wrap all routes. It appears that the behavior of akka-http is to only return the first HttpMethod that was rejected - even

Re: [akka-user] Re: CORS Support Akka-http

2015-09-22 Thread Patrick Ting
Hi Everyone, I ended up porting and modifying Ganta's original CORS support with an existing one I had that I pulled from the Spray mailing list awhile back and posted it here: https://gist.github.com/pcting/2e65c36f868c5cee7d6a The most frustrating part was finding a way around the loss of

Re: [akka-user] Re: CORS Support Akka-http

2015-08-17 Thread Austin Guest
Hi Yar. Thanks for getting back! The error message was regarding headers missing from the *server's* response to the actual POST request (it handled the pre-flight OPTIONS request just fine, which is why I was puzzled. I've since resolved the question, as it was a matter (as the blog you

[akka-user] Re: CORS Support Akka-http

2015-08-16 Thread Austin Guest
Great implementation `yar...`! Question: I borrowed this code in my own implementation but ran into an odd problem where it worked just fine on the preflight `OPTIONS` request, but then omitted the CORS headers from the subsequent `POST` that was getting preflighted, causing the request to be

Re: [akka-user] Re: CORS Support Akka-http

2015-08-16 Thread Yar Ilich
Hi, pleasure to be of use. I got confused: did client part omit headers from POST request? Where did you get the message No 'Access-Control-Allow-Origin' header is present on the requested resource. from? The problem may be some caveats of using Access-Control-Allow-Origin. See

[akka-user] Re: CORS Support Akka-http

2015-06-18 Thread yar . ilich
Hi, I didn't find a counterpart of mapRequestContext in akka-http, so I just allow all the methods I have in my route. Here is my shot at CORS in akka-http: import akka.http.scaladsl.model.HttpMethods._ import akka.http.scaladsl.model.HttpResponse import akka.http.scaladsl.model.headers._

[akka-user] Re: CORS Support Akka-http

2015-06-17 Thread Mariano Treb
I am having the same problem!!! How did you solved it? I have been working for days and I cant find any good solution. El martes, 10 de marzo de 2015, 18:48:09 (UTC+1), Tim Pigden escribió: This thread may help:

Re: [akka-user] Re: CORS Support Akka-http

2015-06-17 Thread Tim Pigden
I'll get my colleague to post something He did the work On 17 Jun 2015 15:34, Mariano Treb marianotreb...@gmail.com wrote: I am having the same problem!!! How did you solved it? I have been working for days and I cant find any good solution. El martes, 10 de marzo de 2015, 18:48:09 (UTC+1),