diff --git a/server.go b/server.go index e435bdc..82251fc 100644 --- a/server.go +++ b/server.go @@ -682,12 +682,10 @@ func (hc *HttpApiHandlerContainer) RegistReceiver(receiver HttpApiReceiver) { } } -func (hc *HttpApiHandlerContainer) Call(w http.ResponseWriter, r *http.Request) { - lastSlash := strings.LastIndex(r.URL.Path, "/") - fname := r.URL.Path[lastSlash:] - if found := hc.methods[fname]; found != nil { +func (hc *HttpApiHandlerContainer) Call(funcname string, w http.ResponseWriter, r *http.Request) { + if found := hc.methods[funcname]; found != nil { found(w, r) } else { - logger.Println("api is not found :", fname) + logger.Println("api is not found :", funcname) } }