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

Disable keepalive to keep server from serving stale results.

Klaus Postf8101771c960
diff --git a/oauthutil/oauthutil.go b/oauthutil/oauthutil.go
index 3962af81b..c16d94277 100644
--- a/oauthutil/oauthutil.go
+++ b/oauthutil/oauthutil.go
@@ -319,15 +319,17 @@ func (s *authServer) Start() {
Addr: s.bindAddress,
Handler: mux,
}
+ server.SetKeepAlivesEnabled(false)
mux.HandleFunc("/favicon.ico", func(w http.ResponseWriter, req *http.Request) {
http.Error(w, "", 404)
return
})
mux.HandleFunc("/auth", func(w http.ResponseWriter, req *http.Request) {
- http.Redirect(w, req, s.authURL, 307)
+ http.Redirect(w, req, s.authURL, http.StatusTemporaryRedirect)
return
})
mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
+ w.Header().Set("Content-Type", "text/html")
fs.Debug(nil, "Received request on auth server")
code := req.FormValue("code")
if code != "" {
@@ -347,8 +349,9 @@ func (s *authServer) Start() {
return
}
fs.Debug(nil, "No code found on request")
- fmt.Fprintf(w, "<h1>Failed!</h1>\nNo code found.")
- http.Error(w, "", 500)
+ w.WriteHeader(500)
+ fmt.Fprintf(w, "<h1>Failed!</h1>\nNo code found returned by remote server.")
+
})
var err error