Add bypass login for TP-Link cameras

This commit is contained in:
Alexey Khit
2023-02-10 11:16:03 +03:00
parent f60b55b6fa
commit 80f77d28c8
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -220,12 +220,15 @@ func (c *Conn) Do(req *tcp.Request) (*tcp.Response, error) {
if res.StatusCode == http.StatusUnauthorized {
switch c.auth.Method {
case tcp.AuthNone:
if c.auth.ReadNone(res) {
return c.Do(req)
}
return nil, errors.New("user/pass not provided")
case tcp.AuthUnknown:
if c.auth.Read(res) {
return c.Do(req)
}
case tcp.AuthBasic, tcp.AuthDigest:
default:
return nil, errors.New("wrong user/pass")
}
}