From b21044fe42b970b7cea74be674c38637ee28bf78 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 17 May 2016 20:42:35 +0200 Subject: [PATCH] Add CORS headers to Read Only Gateway Default config License: MIT Signed-off-by: Jakub Sztandera --- repo/config/init.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repo/config/init.go b/repo/config/init.go index f8f4a4890..35ccda36b 100644 --- a/repo/config/init.go +++ b/repo/config/init.go @@ -62,6 +62,11 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { RootRedirect: "", Writable: false, PathPrefixes: []string{}, + HTTPHeaders: map[string][]string{ + "Access-Control-Allow-Origin": []string{"*"}, + "Access-Control-Allow-Methods": []string{"GET"}, + "Access-Control-Allow-Headers": []string{"X-Requested-With"}, + }, }, }