mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-13 00:07:59 +02:00
pkg/updates: Fix resource availability check in Updater
When trying to download an update, a 'Could not find any binary at ...' error message is shown erroneously. This happens since when checking the availability, a response code of 403 ('Forbidden') instead of 200 ('OK') is expected. Since 'http.Head()' handles redirects automatically, there is no need to also accept 3xx status codes. Fixes #1450.
This commit is contained in:
parent
4fde97b066
commit
4b56d428ff
@ -329,7 +329,6 @@ func (u *Updater) verifyResourceFound(rawUrl string) bool {
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
u.Log.Info("Received status code ", resp.StatusCode)
|
u.Log.Info("Received status code ", resp.StatusCode)
|
||||||
// 403 means the resource is there (not going to bother adding extra request headers)
|
// OK (200) indicates that the resource is present.
|
||||||
// 404 means its not
|
return resp.StatusCode == http.StatusOK
|
||||||
return resp.StatusCode == 403
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user