diff options
author | dev <navdgo@gmail.com> | 2019-06-05 13:10:19 -0400 |
---|---|---|
committer | dev <navdgo@gmail.com> | 2019-06-07 11:40:25 -0400 |
commit | 37da91cfe703bc9f14ddec007092d39610a02861 (patch) | |
tree | eba734f11c16b85418a78cc3afe47f0c63b60ece /admin.go | |
parent | b79f86f256782be139d4ec09a74e0f75da52876a (diff) |
fix module import paths and add cors to admin endpoints
fix go module refs and add cors to admin endpoints
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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, |