summaryrefslogtreecommitdiffstats
path: root/modules/lfs
diff options
context:
space:
mode:
authorhiifong <i@hiif.ong>2024-12-14 04:35:19 +0100
committerEarl Warren <contact@earl-warren.org>2024-12-15 10:14:21 +0100
commit14a5d177e1e16225c79f63aff795dfcd5ebd2007 (patch)
tree0d5cab00157f03b6629712a142835a886f6a8c0f /modules/lfs
parentFix missing outputs for jobs with matrix (#32823) (diff)
downloadforgejo-14a5d177e1e16225c79f63aff795dfcd5ebd2007.tar.xz
forgejo-14a5d177e1e16225c79f63aff795dfcd5ebd2007.zip
Add User-Agent for gitea's self-implemented lfs client. (#32832)
(cherry picked from commit 82c59d52ea650ce42bbca2c6740d9449d06e77be)
Diffstat (limited to 'modules/lfs')
-rw-r--r--modules/lfs/shared.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/lfs/shared.go b/modules/lfs/shared.go
index 40ad789c1d..cd9488e3db 100644
--- a/modules/lfs/shared.go
+++ b/modules/lfs/shared.go
@@ -14,9 +14,12 @@ import (
const (
// MediaType contains the media type for LFS server requests
MediaType = "application/vnd.git-lfs+json"
- // Some LFS servers offer content with other types, so fallback to '*/*' if application/vnd.git-lfs+json cannot be served
- AcceptHeader = "application/vnd.git-lfs+json;q=0.9, */*;q=0.8"
- UserAgentHeader = "git-lfs"
+ // AcceptHeader Some LFS servers offer content with other types, so fallback to '*/*' if application/vnd.git-lfs+json cannot be served
+ AcceptHeader = "application/vnd.git-lfs+json;q=0.9, */*;q=0.8"
+ // UserAgentHeader Add User-Agent for gitea's self-implemented lfs client,
+ // and the version is consistent with the latest version of git lfs can be avoided incompatibilities.
+ // Some lfs servers will check this
+ UserAgentHeader = "git-lfs/3.6.0 (Gitea)"
)
// BatchRequest contains multiple requests processed in one batch operation.