mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-21 02:55:37 -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
|
return nil, err
|
||||||
}
|
}
|
||||||
// anything inside the range [200, 299] is considered a success
|
// 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)
|
message := "HTTP status code " + strconv.Itoa(response.StatusCode)
|
||||||
err := errors.New(message)
|
err := errors.New(message)
|
||||||
env.log(Error, "HTTPRequest", message)
|
env.log(Error, "HTTPRequest", message)
|
||||||
|
|
Loading…
Reference in a new issue