diff --git a/docs/SNAPTELD_CONFIGURATION.md b/docs/SNAPTELD_CONFIGURATION.md index 87b1bbb65..aff7afc5d 100644 --- a/docs/SNAPTELD_CONFIGURATION.md +++ b/docs/SNAPTELD_CONFIGURATION.md @@ -196,7 +196,7 @@ restapi: # port sets the port to start the REST API server on. Default is 8181 port: 8181 - # corsd sets the allowed origins in a comma separated list. It defaults to the same origin if the value is empty. + # allowed_origins sets the allowed origins in a comma separated list. It defaults to the same origin if the value is empty. allowed_origins: http://127.0.0.1:8080, http://snap.example.io, http://example.com ``` diff --git a/mgmt/rest/server.go b/mgmt/rest/server.go index fa61e027d..237132ece 100644 --- a/mgmt/rest/server.go +++ b/mgmt/rest/server.go @@ -56,22 +56,22 @@ var ( ) type Server struct { - apis []api.API - n *negroni.Negroni - r *httprouter.Router - snapTLS *snapTLS - auth bool - pprof bool - authpwd string - addrString string - addr net.Addr - wg sync.WaitGroup - killChan chan struct{} - err chan error + apis []api.API + n *negroni.Negroni + r *httprouter.Router + snapTLS *snapTLS + auth bool + pprof bool + authpwd string + addrString string + addr net.Addr + wg sync.WaitGroup + killChan chan struct{} + err chan error + allowedOrigins map[string]bool // the following instance variables are used to cleanly shutdown the server serverListener net.Listener closingChan chan bool - allowedOrigins map[string]bool } // New creates a REST API server with a given config