1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

builder-next: use constants for http methods

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-12 20:40:56 +02:00
parent 63e62d13a0
commit 3b84875216
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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)