Skip to content

Commit

Permalink
fix: static page to limit request method (#7745 close #7667)
Browse files Browse the repository at this point in the history
  • Loading branch information
j2rong4cn authored Dec 30, 2024
1 parent 5994c17 commit 365fc40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func Static(r *gin.RouterGroup, noRoute func(handlers ...gin.HandlerFunc)) {
}

noRoute(func(c *gin.Context) {
if c.Request.Method != "GET" && c.Request.Method != "POST" {
c.Status(405)
return
}
c.Header("Content-Type", "text/html")
c.Status(200)
if strings.HasPrefix(c.Request.URL.Path, "/@manage") {
Expand Down

0 comments on commit 365fc40

Please sign in to comment.