Fix S3 object storage failing when endpoint is not specified

Merged Stan Hu requested to merge revert-fb45e290 into master

This reverts !53326 (merged) since the endpoint created from the pre-signed URL is incorrect. For S3 virtual hostnames (e.g. https://bucket.us-west-1.amazonaws.com, the bucket name should be ignored, so the endpoint should be https://us-west-1.amazonaws.com in this case. This causes the wrong endpoint to be used (https://bucket.bucket.us-west-1.amazonaws.com).

A workaround for AWS S3 users is to pass endpoint: https://s3.amazonaws.com as a config.

Relates to gitlab-org/charts/gitlab#2589 (closed)

Edited by Stan Hu