forked from External/mediamtx
This commit is contained in:
parent
1c2f95f609
commit
f4b7f147a5
2 changed files with 4 additions and 0 deletions
|
|
@ -190,6 +190,7 @@ func (a *API) Initialize() error {
|
||||||
router := gin.New()
|
router := gin.New()
|
||||||
router.SetTrustedProxies(a.TrustedProxies.ToTrustedProxies()) //nolint:errcheck
|
router.SetTrustedProxies(a.TrustedProxies.ToTrustedProxies()) //nolint:errcheck
|
||||||
|
|
||||||
|
router.NoRoute(a.middlewareOrigin, a.middlewareAuth)
|
||||||
group := router.Group("/", a.middlewareOrigin, a.middlewareAuth)
|
group := router.Group("/", a.middlewareOrigin, a.middlewareAuth)
|
||||||
|
|
||||||
group.GET("/v3/config/global/get", a.onConfigGlobalGet)
|
group.GET("/v3/config/global/get", a.onConfigGlobalGet)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,10 @@ type Server struct {
|
||||||
func (s *Server) Initialize() error {
|
func (s *Server) Initialize() error {
|
||||||
router := gin.New()
|
router := gin.New()
|
||||||
router.SetTrustedProxies(s.TrustedProxies.ToTrustedProxies()) //nolint:errcheck
|
router.SetTrustedProxies(s.TrustedProxies.ToTrustedProxies()) //nolint:errcheck
|
||||||
|
|
||||||
|
router.NoRoute(s.middlewareOrigin)
|
||||||
group := router.Group("/", s.middlewareOrigin)
|
group := router.Group("/", s.middlewareOrigin)
|
||||||
|
|
||||||
group.GET("/list", s.onList)
|
group.GET("/list", s.onList)
|
||||||
group.GET("/get", s.onGet)
|
group.GET("/get", s.onGet)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue