Merge pull request #961 from janza/master

Fix crash with tapo cameras not returning 401
This commit is contained in:
Alex X
2024-04-22 20:14:27 +03:00
committed by GitHub
+1 -1
View File
@@ -281,7 +281,7 @@ func dial(req *http.Request) (net.Conn, *http.Response, error) {
auth := res.Header.Get("WWW-Authenticate")
if res.StatusCode != http.StatusUnauthorized || !strings.HasPrefix(auth, "Digest") {
return nil, nil, err
return nil, nil, fmt.Errorf("Expected StatusCode to be %d, received %d", http.StatusUnauthorized, res.StatusCode)
}
if password == "" {