This commit is contained in:
aozhiwei 2020-10-30 17:43:06 +08:00
parent 3a39acfd9b
commit ce7a0fd64c

View File

@ -77,8 +77,11 @@ func (this *HttpServer) dispatchRequest(w http.ResponseWriter, r *http.Request)
func (this *HttpServer) getHandle(handleName string) (func(*http.ResponseWriter, *http.Request)) {
this.handlersMutex.Lock()
defer this.handlersMutex.Unlock()
handle, _ := this.handlers[handleName]
if handle, ok := this.handlers[handleName]; ok {
return handle
} else {
return nil
}
}
func (this *HttpServer) RegisterHandle(c string, a string,