Fix a bug when setting host header in httpjson

closes #634
This commit is contained in:
Reginaldo Sousa 2016-02-02 17:22:15 -02:00 committed by Cameron Sparr
parent 0d391b66a3
commit 9406961125
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ func (h *HttpJson) sendRequest(serverURL string) (string, float64, error) {
// Add header parameters
for k, v := range h.Headers {
req.Header.Add(k, v)
if strings.ToLower(k) == "host" {
req.Host = v
} else {
req.Header.Add(k, v)
}
}
start := time.Now()