netlify / git-gateway

A Gateway to Git APIs
MIT License
400 stars 89 forks source link

fix: set CORS 'Access-Control-Max-Age' header to 86400 seconds #55

Closed erezrokah closed 4 years ago

erezrokah commented 4 years ago

This allows better caching of preflight requests (https://fetch.spec.whatwg.org/#http-access-control-max-age). Not setting it defaults to 5 seconds. GitHub and Bitbucket use a value of 86400 seconds, while GitLab uses 7200. These values correspond with the maximum values for Firefox and Chrome: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age