Set the max_age value for CORS to a default that's not null.
Every request in the application gets effectively 'doubled' by the need of a preflight CORS request. By setting the max_age option, we can cache the responses of the preflight, which negates the needs of a preflight for every individual request. (ht to @mvhirsch in https://github.com/directus/api/issues/917)
Swap out null for a value (in seconds) like 600 (10 minutes)
Can we think of any reason why we _shouldn't_ change this? @theharshin @bjgajjar
Ref:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
:grin: #921
Lets take a second before merging to verify we don't break anything 馃榿
Just preparing. Closing is always an option :grin:
@rijkvanzanten Looks fine to me. Just to mention that we're setting this at the maximum allowed in Chromium browsers. Ref.
Most helpful comment
@rijkvanzanten Looks fine to me. Just to mention that we're setting this at the maximum allowed in Chromium browsers. Ref.