mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
disable echo auth
This commit is contained in:
@@ -5,9 +5,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
sets "server/settings"
|
sets "server/settings"
|
||||||
"server/torr"
|
"server/torr"
|
||||||
"server/version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type requestI struct {
|
type requestI struct {
|
||||||
@@ -15,7 +15,6 @@ type requestI struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SetupRoute(route *gin.RouterGroup) {
|
func SetupRoute(route *gin.RouterGroup) {
|
||||||
route.GET("/echo", echo)
|
|
||||||
route.GET("/shutdown", shutdown)
|
route.GET("/shutdown", shutdown)
|
||||||
|
|
||||||
route.POST("/settings", settings)
|
route.POST("/settings", settings)
|
||||||
@@ -38,10 +37,6 @@ func SetupRoute(route *gin.RouterGroup) {
|
|||||||
route.GET("/playlist/*fname", playList)
|
route.GET("/playlist/*fname", playList)
|
||||||
}
|
}
|
||||||
|
|
||||||
func echo(c *gin.Context) {
|
|
||||||
c.String(200, "%v", version.Version)
|
|
||||||
}
|
|
||||||
|
|
||||||
func shutdown(c *gin.Context) {
|
func shutdown(c *gin.Context) {
|
||||||
if sets.ReadOnly {
|
if sets.ReadOnly {
|
||||||
c.Status(http.StatusForbidden)
|
c.Status(http.StatusForbidden)
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ func Start(port string) {
|
|||||||
route := gin.New()
|
route := gin.New()
|
||||||
route.Use(gin.Recovery(), cors.Default())
|
route.Use(gin.Recovery(), cors.Default())
|
||||||
|
|
||||||
|
route.GET("/echo", echo)
|
||||||
|
|
||||||
routeAuth := auth.SetupAuth(route)
|
routeAuth := auth.SetupAuth(route)
|
||||||
if routeAuth != nil {
|
if routeAuth != nil {
|
||||||
api.SetupRoute(routeAuth)
|
api.SetupRoute(routeAuth)
|
||||||
@@ -49,3 +51,7 @@ func Stop() {
|
|||||||
BTS.Disconnect()
|
BTS.Disconnect()
|
||||||
waitChan <- nil
|
waitChan <- nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func echo(c *gin.Context) {
|
||||||
|
c.String(200, "%v", version.Version)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user