We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea52e6f commit 1a936f5Copy full SHA for 1a936f5
1 file changed
request/http.go
@@ -27,12 +27,9 @@ func (r *Http) SetSecret(secret dmfr.Secret) error {
27
}
28
29
func removeDefaultPortFromHost(req *http.Request) {
30
- if req.URL.Scheme == "https" && strings.HasSuffix(req.URL.Host, ":443") {
31
- host := strings.TrimSuffix(req.URL.Host, ":443")
32
- req.Host = host
33
- } else if req.URL.Scheme == "http" && strings.HasSuffix(req.URL.Host, ":80") {
34
- host := strings.TrimSuffix(req.URL.Host, ":80")
35
+ if (req.URL.Scheme == "https" && strings.HasSuffix(req.URL.Host, ":443")) ||
+ (req.URL.Scheme == "http" && strings.HasSuffix(req.URL.Host, ":80")) {
+ req.Host = strings.Split(req.URL.Host, ":")[0]
36
37
38
0 commit comments