From d9df58beb87c2c7e9b32260118ceb7f86d8a2856 Mon Sep 17 00:00:00 2001 From: Chris Ridde Date: Thu, 10 Jul 2014 17:02:41 +0100 Subject: [PATCH] Added Access-Control-Allow-Headers to allow cors requests with those headers --- http/cors.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http/cors.go b/http/cors.go index eabd6ca7f..2729cde57 100644 --- a/http/cors.go +++ b/http/cors.go @@ -54,6 +54,7 @@ type CORSHandler struct { func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) { w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE") w.Header().Add("Access-Control-Allow-Origin", origin) + w.Header().Add("Access-Control-Allow-Headers", "accept, content-type") } // ServeHTTP adds the correct CORS headers based on the origin and returns immediately