From 1d1cfbd17387baa88d206cb07f580ec1a8257b1b Mon Sep 17 00:00:00 2001 From: jholdstock Date: Fri, 9 Jan 2026 09:08:17 +0000 Subject: [PATCH] Don't read HTTP body unnecessarily. Using request.ParseForm causes the body of every request to be read. dcrwebapi only uses query params and GET methods, therefore this was completely unnecessary and was wasting time/resources. --- service.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/service.go b/service.go index 1f9b27e..81bb48e 100644 --- a/service.go +++ b/service.go @@ -332,13 +332,7 @@ func info(service *Service) error { // HandleRoutes is the handler func for all endpoints exposed by the service func (service *Service) HandleRoutes(writer http.ResponseWriter, request *http.Request) { - err := request.ParseForm() - if err != nil { - writeJSONErrorResponse(&writer, err) - return - } - - route := request.FormValue("c") + route := request.URL.Query().Get("c") switch route { case "vsp":