Skip to content

Commit

Permalink
fix: do not put default port in url
Browse files Browse the repository at this point in the history
  • Loading branch information
albertolerda committed Aug 23, 2023
1 parent 70a2293 commit e6318c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/restroom-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func (args *Args) loadCli() {
}

func (args Args) requestUrl() string {
if (args.scheme == "http" && args.port == 80) ||
(args.scheme == "https" && args.port == 443) {
return fmt.Sprintf("%s://%s/api/%s", args.scheme, args.host, args.url)
}
return fmt.Sprintf("%s://%s:%d/api/%s", args.scheme, args.host, args.port, args.url)
}

Expand Down Expand Up @@ -111,6 +115,7 @@ func main() {
}
if resp.StatusCode != 200 {
log.Printf("Received status code %d in response\n", resp.StatusCode)
log.Println(resp)
os.Exit(-1)
}
//var rr map[string]string
Expand Down

0 comments on commit e6318c0

Please sign in to comment.