go fmt
This commit is contained in:
parent
6c953e0326
commit
d6469022fe
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue