Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

lib/http: fix race condition

Nick Craig-Wood5db4493557cd
diff --git a/lib/http/context.go b/lib/http/context.go
index 34bff8fa6..239572c75 100644
--- a/lib/http/context.go
+++ b/lib/http/context.go
@@ -19,12 +19,9 @@ const (
func NewBaseContext(ctx context.Context, url string) func(l net.Listener) context.Context {
return func(l net.Listener) context.Context {
if l.Addr().Network() == "unix" {
- ctx = context.WithValue(ctx, ctxKeyUnixSock, true)
- return ctx
+ return context.WithValue(ctx, ctxKeyUnixSock, true)
}
-
- ctx = context.WithValue(ctx, ctxKeyPublicURL, url)
- return ctx
+ return context.WithValue(ctx, ctxKeyPublicURL, url)
}
}