From 2715203d9639915d040622efb5169fad1b9edf19 Mon Sep 17 00:00:00 2001 From: Paul Bonser Date: Thu, 13 Oct 2016 02:54:52 -0500 Subject: [PATCH] Leave off extra leading slash in bulk requests --- request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/request.go b/request.go index abe05a2..bf8093d 100644 --- a/request.go +++ b/request.go @@ -47,7 +47,10 @@ type Request struct { // URL builds a URL for a Request func (req *Request) URL() *url.URL { - path := "/" + strings.Join(req.IndexList, ",") + var path string + if len(req.IndexList) > 0 { + path = "/" + strings.Join(req.IndexList, ",") + } if len(req.TypeList) > 0 { path += "/" + strings.Join(req.TypeList, ",")