diff --git a/internal/core/hls_muxer.go b/internal/core/hls_muxer.go index 360f2d15..e2a7fd15 100644 --- a/internal/core/hls_muxer.go +++ b/internal/core/hls_muxer.go @@ -480,7 +480,7 @@ func (m *hlsMuxer) authenticate(ctx *gin.Context) error { if m.externalAuthenticationURL != "" { ip := net.ParseIP(ctx.ClientIP()) - user, pass, _ := ctx.Request.BasicAuth() + user, pass, ok := ctx.Request.BasicAuth() err := externalAuth( m.externalAuthenticationURL, @@ -491,6 +491,10 @@ func (m *hlsMuxer) authenticate(ctx *gin.Context) error { false, ctx.Request.URL.RawQuery) if err != nil { + if !ok { + return pathErrAuthNotCritical{} + } + return pathErrAuthCritical{ message: fmt.Sprintf("external authentication failed: %s", err), }