mirror of
https://github.com/miniflux/v2.git
synced 2024-09-29 05:43:28 +02:00
Add DELETE method to CORS header
This commit is contained in:
parent
adbebd4de8
commit
ec18abc97f
@ -24,9 +24,9 @@ func newMiddleware(s *storage.Storage) *middleware {
|
|||||||
func (m *middleware) handleCORS(next http.Handler) http.Handler {
|
func (m *middleware) handleCORS(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, OPTIONS")
|
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token")
|
w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token")
|
||||||
if r.Method == "OPTIONS" {
|
if r.Method == http.MethodOptions {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user