"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
http: add --user-agent option. close #1557
Alex McGrath Kraak2cc907179138
diff --git a/fs/config.go b/fs/config.goindex 76044116d..0ec998274 100644--- a/fs/config.go+++ b/fs/config.go@@ -101,6 +101,7 @@ var (tpsLimitBurst = IntP("tpslimit-burst", "", 1, "Max burst of transactions for --tpslimit.")bindAddr = StringP("bind", "", "", "Local address to bind to for outgoing connections, IPv4, IPv6 or name.")disableFeatures = StringP("disable", "", "", "Disable a comma separated list of features. Use help to see a list.")+ userAgent = StringP("user-agent", "", "rclone/"+Version, "Set the user-agent to a specified string. The default is rclone/ version")logLevel = LogLevelNoticestatsLogLevel = LogLevelInfobwLimit BwTimetablediff --git a/fs/fs.go b/fs/fs.goindex 86af2c273..0bba2ed10 100644--- a/fs/fs.go+++ b/fs/fs.go@@ -28,8 +28,6 @@ const (// Globalsvar (- // UserAgent set in the default Transport- UserAgent = "rclone/" + Version// Filesystem registryfsRegistry []*RegInfo// ErrorNotFoundInConfigFile is returned by NewFs if not found in config filediff --git a/fs/http.go b/fs/http.goindex b6db85601..3b76a2f5d 100644--- a/fs/http.go+++ b/fs/http.go@@ -241,7 +241,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error}}// Force user agent- req.Header.Set("User-Agent", UserAgent)+ req.Header.Set("User-Agent", *userAgent)// Logf requestif t.logHeader || t.logBody || t.logAuth {buf, _ := httputil.DumpRequestOut(req, t.logBody)