mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
ghttp.Server URL path严谨性校验
This commit is contained in:
@ -84,6 +84,9 @@ func (s *Server) getHookHandlerWithCache(hook string, r *Request) []*handlerPars
|
||||
|
||||
// 事件方法检索
|
||||
func (s *Server) searchHookHandler(method, path, domain, hook string) []*handlerParsedItem {
|
||||
if len(path) == 0 {
|
||||
return nil
|
||||
}
|
||||
// 遍历检索的域名列表
|
||||
domains := []string{ gDEFAULT_DOMAIN }
|
||||
if !strings.EqualFold(gDEFAULT_DOMAIN, domain) {
|
||||
|
||||
@ -31,6 +31,9 @@ func (s *Server) getServeHandlerWithCache(r *Request) *handlerParsedItem {
|
||||
|
||||
// 服务方法检索
|
||||
func (s *Server) searchServeHandler(method, path, domain string) *handlerParsedItem {
|
||||
if len(path) == 0 {
|
||||
return nil
|
||||
}
|
||||
// 遍历检索的域名列表
|
||||
domains := []string{ gDEFAULT_DOMAIN }
|
||||
if !strings.EqualFold(gDEFAULT_DOMAIN, domain) {
|
||||
|
||||
Reference in New Issue
Block a user