fix: typo

Signed-off-by: LesCyber <andi4cing@gmail.com>
This commit is contained in:
LesCyber 2025-03-06 10:09:18 +08:00
parent 6aaf65009c
commit b1868d4bef
2 changed files with 3 additions and 3 deletions

View file

@ -104,7 +104,7 @@ func sendPostRequest(marshalledJSON []byte, cfg *config) ([]byte, error) {
}
// Handle unsuccessful HTTP responses
if httpResponse.StatusCode < 200 || httpResponse.StatusCode >= 300 {
if httpResponse.StatusCode < http.StatusOK || httpResponse.StatusCode >= http.StatusMultipleChoices {
// Generate a standard error to return if the server body is
// empty. This should not happen very often, but it's better
// than showing nothing in case the target server has a poor

View file

@ -229,7 +229,7 @@ func getServiceURL(rootURL string) (url string, err error) {
return
}
defer r.Body.Close()
if r.StatusCode >= 400 {
if r.StatusCode >= http.StatusBadRequest {
err = errors.New(fmt.Sprint(r.StatusCode))
return
}
@ -312,7 +312,7 @@ func soapRequest(url, function, message string) (replyXML []byte, err error) {
defer r.Body.Close()
}
if r.StatusCode >= 400 {
if r.StatusCode >= http.StatusBadRequest {
err = errors.New("Error " + strconv.Itoa(r.StatusCode) + " for " + function)
r = nil
return