Skip to content

Commit 887ee4d

Browse files
hiifongGiteaBot
authored andcommitted
Fix lfs migration (go-gitea#32812)
Fix: go-gitea#32803
1 parent 4fe19fc commit 887ee4d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/lfs/http_client.go

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ func createRequest(ctx context.Context, method, url string, headers map[string]s
211211
req.Header.Set(key, value)
212212
}
213213
req.Header.Set("Accept", AcceptHeader)
214+
req.Header.Set("User-Agent", UserAgentHeader)
214215

215216
return req, nil
216217
}

modules/lfs/shared.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const (
1515
// MediaType contains the media type for LFS server requests
1616
MediaType = "application/vnd.git-lfs+json"
1717
// Some LFS servers offer content with other types, so fallback to '*/*' if application/vnd.git-lfs+json cannot be served
18-
AcceptHeader = "application/vnd.git-lfs+json;q=0.9, */*;q=0.8"
18+
AcceptHeader = "application/vnd.git-lfs+json;q=0.9, */*;q=0.8"
19+
UserAgentHeader = "git-lfs"
1920
)
2021

2122
// BatchRequest contains multiple requests processed in one batch operation.

0 commit comments

Comments
 (0)