metosin/reitit

Bundled CORS-support

Open

#236 aberto em 11 de mar. de 2019

Ver no GitHub
 (9 comments) (22 reactions) (0 assignees)Clojure (261 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (1.569 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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:

Related issues:

Guia do colaborador