Skip to content

Commit

Permalink
🐛 Exclude standard ports from url string
Browse files Browse the repository at this point in the history
This string is used to make requests. Having the port in the url breaks
http to https redirects
  • Loading branch information
jaym committed Dec 19, 2024
1 parent f19188a commit 5a4613d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/network/resources/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func (x *mqlUrl) string() (string, error) {
}

host := x.Host.Data
if x.Port.Data != 0 {
isStandardPort := x.Port.Data == 80 && x.Scheme.Data == "http" || x.Port.Data == 443 && x.Scheme.Data == "https"
if x.Port.Data != 0 && !isStandardPort {
host += ":" + strconv.Itoa(int(x.Port.Data))
}

Expand Down

0 comments on commit 5a4613d

Please sign in to comment.