Skip to content

Commit 087bbc1

Browse files
committed
strip port from host
1 parent a1543d2 commit 087bbc1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strconv"
1212
"sync"
1313
"time"
14+
"strings"
1415

1516
"gopkg.in/yaml.v2"
1617

@@ -182,6 +183,7 @@ func (p *ProxyServer) proxyRequest(r *http.Request) {
182183
p.totalRequests.Inc()
183184

184185
host := r.Host // The front-facing host
186+
host , _, _ = strings.Cut(host, ":") //strip port
185187
backends, found := p.getBackendsForHost(host)
186188

187189
if !found || len(backends) == 0 {

0 commit comments

Comments
 (0)