1 From 292dd07ebd79a5236921231d82c85bcb3874f188 Mon Sep 17 00:00:00 2001
2 From: Jelle van der Waa <jelle@vdwaa.nl>
3 Date: Thu, 19 Nov 2020 14:51:31 +0100
4 Subject: [PATCH] Handle Request.Host containing the server port
6 As written in the net/http/#Request documentation Host may be of the
7 form "host:port" and as defined in rfc4366 section-3.1 the serverName
8 should not contain the port or colon.
10 requester/requester.go | 8 +++++++-
11 1 file changed, 7 insertions(+), 1 deletion(-)
13 diff --git a/requester/requester.go b/requester/requester.go
14 index fd7277e..924d945 100644
15 --- a/requester/requester.go
16 +++ b/requester/requester.go
17 @@ -20,6 +20,7 @@ import (
25 @@ -235,10 +236,15 @@ func (b *Work) runWorkers() {
29 + hostName, _, err := net.SplitHostPort(b.Request.Host);
31 + hostName = b.Request.Host;
34 tr := &http.Transport{
35 TLSClientConfig: &tls.Config{
36 InsecureSkipVerify: true,
37 - ServerName: b.Request.Host,
38 + ServerName: hostName,
40 MaxIdleConnsPerHost: min(b.C, maxIdleConn),
41 DisableCompression: b.DisableCompression,