Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signv4: Strip port 80 & 443 from url #528

Merged
merged 1 commit into from
May 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion minio/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,16 @@ def get_target_url(endpoint_url, bucket_name=None, object_name=None,
parsed_url = urlsplit(endpoint_url)

# Get new host, scheme.
scheme = parsed_url.scheme
host = parsed_url.netloc

# Strip 80/443 ports since curl & browsers do not
# send them in Host header.
if parsed_url.port == 80 or parsed_url.port == 443:
host = parsed_url.hostname

if 's3.amazonaws.com' in host:
host = get_s3_endpoint(bucket_region)
scheme = parsed_url.scheme

url = scheme + '://' + host
if bucket_name:
Expand Down