From 7951814f125dd6da44a9e9f281aded3337c2891b Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 5 Sep 2023 16:43:34 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=EC=9D=84=20=EC=9D=B8=EC=9E=90=EB=A1=9C=20=EB=B0=9B=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) } }