enhancementhelp wanted
描述
Currently, a third party mw/interceptor is needed for CORS. There should be a fast default mw & interceptor for this. Those could be configured either via route data or via mw/interceptor options. Example data format from https://github.com/metosin/reitit/issues/143#issuecomment-422079662:
{:access-control
{:allow-origin "http://foo.example"
:allow-methods #{:get :post :put}
:allow-credentials true
:allow-headers #{"X-PINGOTHER" "Content-Type"}
:expose-headers #{"X-My-Custom-Header" "X-Another-Custom-Header"}
:max-age 86400}}
Some prior work:
- https://github.com/r0man/ring-cors
- https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http/cors.clj
- https://www.playframework.com/documentation/2.7.x/CorsFilter
Related issues: