From d9cfa5fcd3882e0b84dbffa4301e8f7e335b107c Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Wed, 31 Oct 2018 15:31:42 -0700 Subject: [PATCH] Shouldn't require space in HTTP host header (#6743) Fixes #6741 --- cmd/http/listener.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/http/listener.go b/cmd/http/listener.go index 0c3ab658c..5ca585ce2 100644 --- a/cmd/http/listener.go +++ b/cmd/http/listener.go @@ -141,8 +141,8 @@ func getMethodResourceHost(bufConn *BufConn, maxHeaderBytes int) (method string, // HTTP headers are case insensitive, so we should simply convert // each tokens to their lower case form to match 'host' header. token = strings.ToLower(token) - if strings.HasPrefix(token, "host: ") { - host = strings.TrimPrefix(strings.TrimSuffix(token, "\r"), "host: ") + if strings.HasPrefix(token, "host:") { + host = strings.TrimPrefix(strings.TrimSuffix(token, "\r"), "host:") return method, resource, host, nil } }