mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
fix(env): correct logic for successful HTTP request
Resolves #2147 Resolves #2148
This commit is contained in:
parent
00aea0decd
commit
56af13e140
|
@ -607,7 +607,7 @@ func (env *ShellEnvironment) HTTPRequest(targetURL string, timeout int, requestM
|
|||
return nil, err
|
||||
}
|
||||
// anything inside the range [200, 299] is considered a success
|
||||
if response.StatusCode >= 200 && response.StatusCode < 300 {
|
||||
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
||||
message := "HTTP status code " + strconv.Itoa(response.StatusCode)
|
||||
err := errors.New(message)
|
||||
env.log(Error, "HTTPRequest", message)
|
||||
|
|
Loading…
Reference in a new issue