diff --git a/apiHTTPHLS.go b/apiHTTPHLS.go index 589cb999..7db70e6d 100644 --- a/apiHTTPHLS.go +++ b/apiHTTPHLS.go @@ -27,6 +27,7 @@ func HTTPAPIServerStreamHLSM3U8(c *gin.Context) { } if !RemoteAuthorization("HLS", c.Param("uuid"), c.Param("channel"), c.Query("token"), c.ClientIP()) { + c.IndentedJSON(500, Message{Status: 0, Payload: ErrorStreamUnauthorized.Error()}) requestLogger.WithFields(logrus.Fields{ "call": "RemoteAuthorization", }).Errorln(ErrorStreamUnauthorized.Error()) diff --git a/apiHTTPHLSLL.go b/apiHTTPHLSLL.go index e56b19ec..5f4a3e42 100644 --- a/apiHTTPHLSLL.go +++ b/apiHTTPHLSLL.go @@ -25,6 +25,7 @@ func HTTPAPIServerStreamHLSLLInit(c *gin.Context) { } if !RemoteAuthorization("HLS", c.Param("uuid"), c.Param("channel"), c.Query("token"), c.ClientIP()) { + c.IndentedJSON(500, Message{Status: 0, Payload: ErrorStreamUnauthorized.Error()}) requestLogger.WithFields(logrus.Fields{ "call": "RemoteAuthorization", }).Errorln(ErrorStreamUnauthorized.Error()) diff --git a/apiHTTPMSE.go b/apiHTTPMSE.go index 8c09592f..5fb9e851 100644 --- a/apiHTTPMSE.go +++ b/apiHTTPMSE.go @@ -42,6 +42,7 @@ func HTTPAPIServerStreamMSE(c *gin.Context) { } if !RemoteAuthorization("WS", c.Param("uuid"), c.Param("channel"), c.Query("token"), c.ClientIP()) { + c.IndentedJSON(500, Message{Status: 0, Payload: ErrorStreamUnauthorized.Error()}) requestLogger.WithFields(logrus.Fields{ "call": "RemoteAuthorization", }).Errorln(ErrorStreamUnauthorized.Error()) diff --git a/apiHTTPSaveMP4.go b/apiHTTPSaveMP4.go index ab02697a..978b11eb 100644 --- a/apiHTTPSaveMP4.go +++ b/apiHTTPSaveMP4.go @@ -2,11 +2,12 @@ package main import ( "fmt" + "os" + "time" + "github.com/deepch/vdk/format/mp4" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" - "os" - "time" ) // HTTPAPIServerStreamSaveToMP4 func @@ -36,6 +37,7 @@ func HTTPAPIServerStreamSaveToMP4(c *gin.Context) { } if !RemoteAuthorization("save", c.Param("uuid"), c.Param("channel"), c.Query("token"), c.ClientIP()) { + c.IndentedJSON(500, Message{Status: 0, Payload: ErrorStreamUnauthorized.Error()}) requestLogger.WithFields(logrus.Fields{ "call": "RemoteAuthorization", }).Errorln(ErrorStreamUnauthorized.Error()) diff --git a/apiHTTPWebRTC.go b/apiHTTPWebRTC.go index 2c2d38bc..49c72618 100644 --- a/apiHTTPWebRTC.go +++ b/apiHTTPWebRTC.go @@ -26,6 +26,7 @@ func HTTPAPIServerStreamWebRTC(c *gin.Context) { } if !RemoteAuthorization("WebRTC", c.Param("uuid"), c.Param("channel"), c.Query("token"), c.ClientIP()) { + c.IndentedJSON(500, Message{Status: 0, Payload: ErrorStreamUnauthorized.Error()}) requestLogger.WithFields(logrus.Fields{ "call": "RemoteAuthorization", }).Errorln(ErrorStreamUnauthorized.Error())