修复URL校验不严谨的问题

This commit is contained in:
dushixiang
2021-03-05 22:17:08 +08:00
parent 67155ff5c0
commit 644d8842b6
3 changed files with 4 additions and 4 deletions

View File

@ -30,8 +30,8 @@ func Auth(next echo.HandlerFunc) echo.HandlerFunc {
startWithUrls := []string{"/login", "/static", "/favicon.ico", "/logo.svg", "/asciinema"}
download := regexp.MustCompile(`/sessions/\w{8}(-\w{4}){3}-\w{12}/download`)
recording := regexp.MustCompile(`/sessions/\w{8}(-\w{4}){3}-\w{12}/recording`)
download := regexp.MustCompile(`^/sessions/\w{8}(-\w{4}){3}-\w{12}/download`)
recording := regexp.MustCompile(`^/sessions/\w{8}(-\w{4}){3}-\w{12}/recording`)
return func(c echo.Context) error {