<p>I'm sorry if this is a very ignorant question but is it possible for Ambassador to truly handle CORS headers and pre-flight OPTION responses?  </p>

<p>The docs (<a href="https://www.getambassador.io/reference/cors" rel="noreferrer">https://www.getambassador.io/reference/cors</a>) seem kind of ambiguous to me, if there are just hooks to prevent requests, or if it can truly respond on behalf of the services.</p>

<p>Here's my situation: I've got Ambassador in front of all the http requests to some microservices.  For [reasons] we now need a separate domain to make requests into the same Ambassador.  </p>

<p>I have an AuthService configured, and according to the docs "When you use external authorization, each incoming request is authenticated before routing to its destination, including pre-flight OPTIONS requests." Which makes perfect sense, and that's what I'm seeing.  My AuthService is configured to allow things correctly and that seems to be working.  The AuthService responds with the appropriate headers, but Ambassador seems to just ignore that and only cares if the AuthService responds with a 200 or not. (Which seems totally reasonable.)</p>

<p>I have this annotated on my ambassador module:</p>

<pre><code>getambassador.io/config: |
  --- 
  apiVersion: ambassador/v1
  kind:  Module
  name:  ambassador
  config:
    service_port: 8080
    cors:
      origins: [my domain here]
      credentials: true
</code></pre>

<p>And that doesn't seem to do what I'd expect, which is handle the CORS headers and pre-flight... instead it forwards it on to the service to handle all the CORS stuff.  </p>

<p>Turns out, by specifying <code>headers: "Content-Type"</code> in the <code>cors</code> configuration, things just started to work.  Apparently that's not as optional as I thought.</p>

<p>So this is now my module:</p>

<pre><code>getambassador.io/config: |
--- 
apiVersion: ambassador/v1
kind:  Module
name:  ambassador
config:
  service_port: 8080
  cors:
    origins: [my domain here]
    headers: "Content-Type"
    credentials: true
</code></pre>
