mirror of
https://github.com/aler9/gortsplib
synced 2025-10-17 04:31:00 +08:00
update ValidateHeader signature
This commit is contained in:
@@ -35,7 +35,7 @@ func (as *AuthServer) GenerateHeader() []string {
|
|||||||
|
|
||||||
// ValidateHeader validates the Authorization header sent by a client after receiving the
|
// ValidateHeader validates the Authorization header sent by a client after receiving the
|
||||||
// WWW-Authenticate header provided by GenerateHeader().
|
// WWW-Authenticate header provided by GenerateHeader().
|
||||||
func (as *AuthServer) ValidateHeader(header []string, method string, path string) error {
|
func (as *AuthServer) ValidateHeader(header []string, method Method, path string) error {
|
||||||
if len(header) != 1 {
|
if len(header) != 1 {
|
||||||
return fmt.Errorf("Authorization header not provided")
|
return fmt.Errorf("Authorization header not provided")
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ func (as *AuthServer) ValidateHeader(header []string, method string, path string
|
|||||||
}
|
}
|
||||||
|
|
||||||
ha1 := md5Hex(as.user + ":" + as.realm + ":" + as.pass)
|
ha1 := md5Hex(as.user + ":" + as.realm + ":" + as.pass)
|
||||||
ha2 := md5Hex(method + ":" + path)
|
ha2 := md5Hex(string(method) + ":" + path)
|
||||||
response := md5Hex(ha1 + ":" + as.nonce + ":" + ha2)
|
response := md5Hex(ha1 + ":" + as.nonce + ":" + ha2)
|
||||||
|
|
||||||
if inResponse != response {
|
if inResponse != response {
|
||||||
|
Reference in New Issue
Block a user