From d6469022fe835f6eacd77d5ae881fbef4d30eb24 Mon Sep 17 00:00:00 2001 From: Sean Macdonald Date: Sat, 4 Sep 2021 19:34:03 -0400 Subject: [PATCH] go fmt --- cmd/tusd/cli/serve.go | 6 +++--- pkg/handler/unrouted_handler.go | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/tusd/cli/serve.go b/cmd/tusd/cli/serve.go index 6ae58ec..0c3c7bc 100644 --- a/cmd/tusd/cli/serve.go +++ b/cmd/tusd/cli/serve.go @@ -101,9 +101,9 @@ func Serve() { protocol = "https" } - if Flags.CorsOrigin != "" { - stdout.Printf("CORS origin header is %s", Flags.CorsOrigin) - } + if Flags.CorsOrigin != "" { + stdout.Printf("CORS origin header is %s", Flags.CorsOrigin) + } if Flags.HttpSock == "" { stdout.Printf("You can now upload files to: %s://%s%s", protocol, address, basepath) diff --git a/pkg/handler/unrouted_handler.go b/pkg/handler/unrouted_handler.go index e78c3bc..22549cf 100644 --- a/pkg/handler/unrouted_handler.go +++ b/pkg/handler/unrouted_handler.go @@ -217,15 +217,15 @@ func (handler *UnroutedHandler) Middleware(h http.Handler) http.Handler { header := w.Header() - var origin = handler.config.CorsOrigin - if origin == "" { - origin = r.Header.Get("Origin") - } + var origin = handler.config.CorsOrigin + if origin == "" { + origin = r.Header.Get("Origin") + } - if origin != "" { + if origin != "" { - header.Set("Access-Control-Allow-Origin", origin) - header.Set("Vary", "Origin") + header.Set("Access-Control-Allow-Origin", origin) + header.Set("Vary", "Origin") if r.Method == "OPTIONS" { // Preflight request