update gortsplib

This commit is contained in:
aler9 2021-05-30 12:57:23 +02:00
parent 2897288651
commit 9f0c519582
4 changed files with 7 additions and 12 deletions

2
go.mod
View file

@ -5,7 +5,7 @@ go 1.15
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/aler9/gortsplib v0.0.0-20210530100035-9007f20af845
github.com/aler9/gortsplib v0.0.0-20210530105246-d07e93f2453e
github.com/asticode/go-astits v0.0.0-00010101000000-000000000000
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9

4
go.sum
View file

@ -4,8 +4,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2c
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aler9/go-astits v0.0.0-20210423195926-582b09ed7c04 h1:CXgQLsU4uxWAmsXNOjGLbj0A+0IlRcpZpMgI13fmVwo=
github.com/aler9/go-astits v0.0.0-20210423195926-582b09ed7c04/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ=
github.com/aler9/gortsplib v0.0.0-20210530100035-9007f20af845 h1:n+YGbS96Q9cK5GeyGRiAsOw3yX1kIkBmr6T8aVQEKH8=
github.com/aler9/gortsplib v0.0.0-20210530100035-9007f20af845/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
github.com/aler9/gortsplib v0.0.0-20210530105246-d07e93f2453e h1:RlEDgRKJHw0Z07FfsUnuZiqk2lwFwxONXlmiSQCjJrU=
github.com/aler9/gortsplib v0.0.0-20210530105246-d07e93f2453e/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927 h1:95mXJ5fUCYpBRdSOnLAQAdJHHKxxxJrVCiaqDi965YQ=
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927/go.mod h1:vzuE21rowz+lT1NGsWbreIvYulgBpCGnQyeTyFblUHc=
github.com/asticode/go-astikit v0.20.0 h1:+7N+J4E4lWx2QOkRdOf6DafWJMv6O4RRfgClwQokrH8=

View file

@ -209,8 +209,7 @@ func (c *Conn) ValidateCredentials(
}
}()
err := c.authValidator.ValidateHeader(req.Header["Authorization"],
req.Method, req.URL, altURL)
err := c.authValidator.ValidateRequest(req, altURL)
if err != nil {
c.authFailures++
@ -225,9 +224,6 @@ func (c *Conn) ValidateCredentials(
Message: "unauthorized: " + err.Error(),
Response: &base.Response{
StatusCode: base.StatusUnauthorized,
Header: base.Header{
"WWW-Authenticate": c.authValidator.GenerateHeader(),
},
},
}
}
@ -240,7 +236,7 @@ func (c *Conn) ValidateCredentials(
Response: &base.Response{
StatusCode: base.StatusUnauthorized,
Header: base.Header{
"WWW-Authenticate": c.authValidator.GenerateHeader(),
"WWW-Authenticate": c.authValidator.Header(),
},
},
}

View file

@ -24,13 +24,12 @@ func (sh *testServer) OnDescribe(ctx *gortsplib.ServerHandlerOnDescribeCtx) (*ba
sh.authValidator = auth.NewValidator(sh.user, sh.pass, nil)
}
err := sh.authValidator.ValidateHeader(ctx.Req.Header["Authorization"],
ctx.Req.Method, ctx.Req.URL, nil)
err := sh.authValidator.ValidateRequest(ctx.Req, nil)
if err != nil {
return &base.Response{
StatusCode: base.StatusUnauthorized,
Header: base.Header{
"WWW-Authenticate": sh.authValidator.GenerateHeader(),
"WWW-Authenticate": sh.authValidator.Header(),
},
}, nil, nil
}