ghttp.Server URL path严谨性校验

This commit is contained in:
john
2018-08-31 18:46:45 +08:00
parent 5fcc6d1bee
commit 32993c37f6
2 changed files with 6 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {