
##### SUMMARY
<!--- Explain the problem briefly below -->

For a collection install command like `ansible-galaxy collection install -s automation_hub_ci google.cloud`, ansible-galaxy ends up making requests to API endpoints that should end with a trailing slash but ansible-galaxy drops the trailing slash.

On the server side, galaxy issues a 302 redirect to the location with the URL with the trailing slash appended. And ansible-galaxy follows it correctly.

For example, 

ansible-galaxy makes the request:

`https://ci.cloud.redhat.com/api/automation-hub/v3/collections/cloud/google/versions`

which returns a 302 redirect response pointing to:

`https://ci.cloud.redhat.com/api/automation-hub/v3/collections/cloud/google/versions/'

But the redirect is superfluous and slows things down a bit. Depending on conditions, each redirect may take between 100ms and 500ms. 

But that's 100-500ms additional per collection being installed.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
ansible-galaxy

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.10.0.dev0
  config file = /home/adrian/src/ansible/ansible.cfg
  configured module search path = ['/home/adrian/ansible/my-modules']
  ansible python module location = /home/adrian/src/ansible/lib/ansible
  executable location = /home/adrian/src/ansible/bin/ansible
  python version = 3.6.9 (default, Jul  3 2019, 17:57:57) [GCC 8.3.1 20190223 (Red Hat 8.3.1-2)]

```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->

ansible-ah-example.cfg:

```paste below
[defaults]
log_path = $HOME/.ansible/log/ansible.log

[galaxy]
server_list = automation_hub_ci, galaxy

[galaxy_server.automation_hub_ci]
url=https://ci.cloud.redhat.com/api/automation-hub/
# auth_url=https://sso.qa.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
# Fill in your auth info here
# username=
# password=
# token=

[galaxy_server.galaxy]
url=https://galaxy.ansible.com/api/

```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
fedora 30-ish, x86_64

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```yaml

```

`ANSIBLE_CONFIG=ansible-ah-example.cfg ansible-galaxy collection install -s automation_hub_ci google.cloud`

You may need to use a web debugging tool like mitmproxy to see the additional
requests. AFAIK, that info isn't shown any any ansible log/verbose/debug level.

##### EXPECTED RESULTS
One request per galaxy resources needed

##### ACTUAL RESULTS
A request to the wrong url (no trailing slash), that is then followed to correct location

<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```paste below

```

co.GlobalCLIArgs._Singleton__instance = None
    
    context.CLIARGS._store = {'ignore_certs': False}
    yield
    co.GlobalCLIArgs._Singleton__instance = None
@pytest.fixture()
def collection_artifact(tmp_path_factory):
    ''' Creates a collection artifact tarball that is ready to be published '''
    output_dir = to_text(tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Output'))
    tar_path = os.path.join(output_dir, 'namespace-collection-v1.0.0.tar.gz')
    with tarfile.open(tar_path, 'w:gz') as tfile:
        b_io = BytesIO(b"\x00\x01\x02\x03")
        tar_info = tarfile.TarInfo('test')
        tar_info.size = 4
        tar_info.mode = 0o0644
        tfile.addfile(tarinfo=tar_info, fileobj=b_io)
    yield tar_path
def get_test_galaxy_api(url, version, token_ins=None, token_value=None):
    token_value = token_value or "my token"
    token_ins = token_ins or GalaxyToken(token_value)
    api = GalaxyAPI(None, "test", url)
    # Warning, this doesn't test g_connect() because _availabe_api_versions is set here.  That means
    # that urls for v2 servers have to append '/api/' themselves in the input data.
    api._available_api_versions = {version: '%s' % version}
    api.token = token_ins
    return api
def test_api_no_auth():