From 3b8487521676f6065f6734c080ba9457a43c9090 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 12 Oct 2019 20:40:56 +0200 Subject: [PATCH] builder-next: use constants for http methods Signed-off-by: Sebastiaan van Stijn --- builder/builder-next/reqbodyhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/builder-next/reqbodyhandler.go b/builder/builder-next/reqbodyhandler.go index b07503de13..1017a5e7aa 100644 --- a/builder/builder-next/reqbodyhandler.go +++ b/builder/builder-next/reqbodyhandler.go @@ -42,7 +42,7 @@ func (h *reqBodyHandler) newRequest(rc io.ReadCloser) (string, func()) { func (h *reqBodyHandler) RoundTrip(req *http.Request) (*http.Response, error) { host := req.URL.Host if strings.HasPrefix(host, urlPrefix) { - if req.Method != "GET" { + if req.Method != http.MethodGet { return nil, errors.Errorf("invalid request") } id := strings.TrimPrefix(host, urlPrefix)