Skip to content

Commit

Permalink
Merge pull request #961 from janza/master
Browse files Browse the repository at this point in the history
Fix crash with tapo cameras not returning 401
  • Loading branch information
AlexxIT authored Apr 22, 2024
2 parents 65b5ca2 + 14a9763 commit fffb22d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/tapo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down

0 comments on commit fffb22d

Please sign in to comment.