your patch would work if you change:
```ruby
port = (pulp_url.port == 443 || pulp_url.port == 80 ? "" : ":#{pulp_url.port}" 
```