title: allowedOrigins not working in akka http server
body: <p>I've setup an akka http server on localhost with port 8091. I am sending data to it from client side using XMLHttpRequest POST but it is showing warning that my cross-origin request is blocked because "Access-Control-Allow-Origin" header is not present. So, I added CORS support to it. My code looks like : </p>
  
  <pre><code>import akka.actor.ActorSystem
  import akka.stream.ActorMaterializer
  import akka.http.scaladsl.server.Directives._
  import akka.http.scaladsl.server.Route
  import akka.http.scaladsl.Http
  import akka.http.scaladsl.model.headers.HttpOriginRange.*
  import ch.megard.akka.http.cors.CorsDirectives._
  import ch.megard.akka.http.cors.CorsSettings
  import scala.concurrent.Future
  
  object Collector{
  
    def main(args: Array[String]): Unit = {
     implicit val system = ActorSystem("collector")
     implicit val materializer = ActorMaterializer()
     implicit val defaultDispatcher = system.dispatcher
     val settings = CorsSettings.defaultSettings.copy(allowedOrigins = *)
     val routes: Route = cors(settings) {
       path("event") {
         post {
            parameters('uuid.as[String], 'url.as[String]) { (uuid, url) =&gt;
          complete {
            Future {
              println("Data is received")
              println("UUID is : " + uuid + " &amp; URL is : " + url)
              System.currentTimeMillis().toString
            }
           }
         }
       }
      }
    }
    Http().bindAndHandle(routes, "localhost", 8091)
    println("server started at 8091")
   }
  }
  </code></pre>
  
  <p>But still my requests are blocked and I am not able to see any data on server also. It is working if I send POST request from terminal via curl command. 
  In the network tab, it is showing 404 status. I am not able to understand why it is showing such behavior. 
  Please guide me what I am doing here. Thanks in advance. </p>