rtsp: prioritise digest authentication
This pull request solves a problem with security cameras that send both basic and digest realms, prioritising digest authentication.
This commit is contained in:
parent
b6b1f4a437
commit
cbcff0f4fb
@ -418,6 +418,12 @@ func (client *RTSPClient) request(method string, customHeaders map[string]string
|
|||||||
if splits[0] == "Content-length" {
|
if splits[0] == "Content-length" {
|
||||||
splits[0] = "Content-Length"
|
splits[0] = "Content-Length"
|
||||||
}
|
}
|
||||||
|
if val, ok := res[splits[0]]; ok {
|
||||||
|
if splits[0] == "WWW-Authenticate" && strings.Contains(val, "Digest") && strings.Contains(splits[1], "Basic") {
|
||||||
|
// prioritise digest authentication
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
res[splits[0]] = splits[1]
|
res[splits[0]] = splits[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user