diff --git a/rest/internal/cors/handlers.go b/rest/internal/cors/handlers.go index f0b4d4fc..9c6d6051 100644 --- a/rest/internal/cors/handlers.go +++ b/rest/internal/cors/handlers.go @@ -79,14 +79,15 @@ func isOriginAllowed(allows []string, origin string) bool { } func setHeader(w http.ResponseWriter, origin string) { - w.Header().Set(allowOrigin, origin) - w.Header().Set(allowMethods, methods) - w.Header().Set(allowHeaders, allowHeadersVal) - w.Header().Set(exposeHeaders, exposeHeadersVal) + header := w.Header() + header.Set(allowOrigin, origin) + header.Set(allowMethods, methods) + header.Set(allowHeaders, allowHeadersVal) + header.Set(exposeHeaders, exposeHeadersVal) if origin != allOrigins { - w.Header().Set(allowCredentials, allowTrue) + header.Set(allowCredentials, allowTrue) } - w.Header().Set(maxAgeHeader, maxAgeHeaderVal) + header.Set(maxAgeHeader, maxAgeHeaderVal) } func setVaryHeaders(w http.ResponseWriter, r *http.Request) { diff --git a/tools/goctl/docker/docker.go b/tools/goctl/docker/docker.go index df03dc09..fc7d2b3d 100644 --- a/tools/goctl/docker/docker.go +++ b/tools/goctl/docker/docker.go @@ -77,7 +77,7 @@ func DockerCommand(c *cli.Context) (err error) { projDir, ok := util.FindProjectPath(goFile) if ok { - fmt.Printf("Hint: run \"docker build ...\" command in dir %q\n", projDir) + fmt.Printf("Hint: run \"docker build ...\" command in dir:\n %s\n", projDir) } return nil