chore: add skipper for secure (#913)

This commit is contained in:
boojack
2023-01-07 10:51:34 +08:00
committed by GitHub
parent 96798e10b4
commit 46c13a4b7f
8 changed files with 74 additions and 6 deletions

View File

@ -1,6 +1,8 @@
package server
import (
"net/http"
"github.com/labstack/echo/v4"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
@ -16,6 +18,10 @@ func composeResponse(data interface{}) response {
}
}
func DefaultGetRequestSkipper(c echo.Context) bool {
return c.Request().Method == http.MethodGet
}
func (server *Server) DefaultAuthSkipper(c echo.Context) bool {
ctx := c.Request().Context()
path := c.Path()