Skip to content

Client auto Host header should omit the port if it is default #2407

@andyHa

Description

@andyHa

The HTTP spec states that the "host" header should only include the port if it isn't the standard port.

However, if an URL like https://my-lovely-bucket.s3-eu-central-1.amazonaws.com:443 is accessed (as generated by the AWS SDK), a port header like host: s3-eu-central-1.amazonaws.com:443 instead of host: s3-eu-central-1.amazonaws.com is submitted. This will break the computed signature of the S3 request.

Note that both (modern browsers - checked with latest FF and chrome) as well as good old curl both strip the port number for standard ports.

I'd say this has to be fixed in client.rs:240 - I'd be happy to provide a PR if this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clientArea: client.E-easyEffort: easy. A task that would be a great starting point for a new contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions