Skip to content

Commit

Permalink
修复URL校验不严谨的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
dushixiang committed Mar 5, 2021
1 parent 67155ff commit 644d884
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"time"
)

const Version = "v0.3.0"
const Version = "v0.3.1"

func main() {
err := Run()
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-terminal",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.3.0",
Expand Down

0 comments on commit 644d884

Please sign in to comment.