This commit is contained in:
HynoR 2025-11-24 15:27:34 +08:00
parent 73ffc68374
commit efde0ff507

View file

@ -40,7 +40,7 @@ func SwaggerHandler() gin.HandlerFunc {
return func(c *gin.Context) {
path := c.Request.URL.Path
path = strings.TrimPrefix(path, "/1panel/swagger")
if !matcher.MatchString(path) {
if !matcher.MatchString(path) && path != "/" {
// 404
c.AbortWithStatus(http.StatusNotFound)
return