mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-13 11:35:52 +01:00
fix: typo
Signed-off-by: LesCyber <andi4cing@gmail.com>
This commit is contained in:
parent
6aaf65009c
commit
b1868d4bef
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
4
upnp.go
4
upnp.go
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue