From f7c395c7d117ae6a521f184ad4b6cf51a9628ee2 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 67179d2e091..bf25820038a 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"}, + }, }, }