Skip to content

Commit

Permalink
feat: do not add default ports to request url
Browse files Browse the repository at this point in the history
koios.Port(80) and koios.Port(443) will be ignored

Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Nov 28, 2022
1 parent fb5239b commit b2a6c74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func APIVersion(version string) Option {
func Port(port uint16) Option {
return Option{
apply: func(c *Client) error {
c.url.Host = fmt.Sprint(c.url.Hostname(), ":", port)
if port != 80 && port != 443 {
c.url.Host = fmt.Sprint(c.url.Hostname(), ":", port)
}
return nil
},
}
Expand Down

0 comments on commit b2a6c74

Please sign in to comment.