From 37da91cfe703bc9f14ddec007092d39610a02861 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 5 Jun 2019 13:10:19 -0400 Subject: fix module import paths and add cors to admin endpoints fix go module refs and add cors to admin endpoints --- admin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'admin.go') diff --git a/admin.go b/admin.go index b3d012b..511ab01 100644 --- a/admin.go +++ b/admin.go @@ -13,6 +13,8 @@ import ( "strings" "sync" "time" + + "github.com/rs/cors" ) var ( @@ -46,8 +48,10 @@ func StartAdmin(addr string) error { mux.Handle(route.Pattern, route) } + handler := cors.Default().Handler(mux) + cfgEndptSrv = &http.Server{ - Handler: mux, + Handler: handler, ReadTimeout: 5 * time.Second, ReadHeaderTimeout: 5 * time.Second, IdleTimeout: 5 * time.Second, -- cgit v1.2.3