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

Host header only checked if provided as lowercase #88

Closed
wants to merge 1 commit into from
Closed

Host header only checked if provided as lowercase #88

wants to merge 1 commit into from

Conversation

elpy1
Copy link

@elpy1 elpy1 commented May 5, 2020

When building the signing request, we are only checking for 'host' -> https://github.com/okigan/awscurl/blob/master/awscurl/awscurl.py#L174

If, for example, I specify --header 'Host: www.google.com', this is completely disregarded, causing many headaches as to why I couldn't auth! Even though HTTP headers are to be considered case-insensitive as per RFC it is known that some servers require the 'host' header have a capitalised first letter.

This change ensures we store the header type as a lower case string.

@okigan
Copy link
Owner

okigan commented May 5, 2020 via email

@elpy1
Copy link
Author

elpy1 commented May 5, 2020

sorry, I should have checked first.

Looks fine to me I guess. Replacing args.header with something like [h.lower() for h in args.headers] (

headers = {k: v for (k, v) in map(lambda s: s.split(": "), args.header)}
) would probably achieve the same result if you only need to check/compare one or two headers.

Either way, thanks for the prompt response! All the best.

@elpy1 elpy1 closed this May 5, 2020
@elpy1 elpy1 deleted the bugfix/host-header branch May 11, 2020 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants