tq: ensure we pass the correct Accept header in verify requests
When we perform a verify request, we need to specify a proper Accept header along with the Content-Type header. Do so. Hoist the setting of the headers before the code which copies headers from the remote side, so that the remote side can override it with a suitable header if necessary. This is required for compatibility with some existing servers.
This commit is contained in:
parent
381498010e
commit
61bc880d9e
@ -35,10 +35,11 @@ func verifyUpload(c *lfsapi.Client, remote string, t *Transfer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
|
||||
req.Header.Set("Accept", "application/vnd.git-lfs+json")
|
||||
for key, value := range action.Header {
|
||||
req.Header.Set(key, value)
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
|
||||
|
||||
mv := c.GitEnv().Int(maxVerifiesConfigKey, defaultMaxVerifyAttempts)
|
||||
mv = tools.MaxInt(defaultMaxVerifyAttempts, mv)
|
||||
|
Loading…
Reference in New Issue
Block a user