This commit is contained in:
wjqserver 2025-03-10 18:53:12 +08:00
parent d26f6d1e1b
commit a18660121a
18 changed files with 638 additions and 118 deletions

View file

@ -37,6 +37,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra
}
}
//rawPath := strings.TrimPrefix(c.Request.URL.Path, "/") // 去掉前缀/
rawPath := strings.TrimPrefix(c.Request.URL.RequestURI(), "/") // 去掉前缀/
re := regexp.MustCompile(`^(http:|https:)?/?/?(.*)`) // 匹配http://或https://开头的路径
matches := re.FindStringSubmatch(rawPath) // 匹配路径