aws4 icon indicating copy to clipboard operation
aws4 copied to clipboard

Added SanitizeHost to fix host / hostname with protocol

Open cainaleaouk opened this issue 7 years ago • 3 comments

I've added a method to remove http and https protocols in case the user passes it in the request. It might be an edge case but improves the safety of the code. Also added some test cases.

cainaleaouk avatar Jul 07 '17 18:07 cainaleaouk

+1 is there something preventing this PR from being merged? Would love to see it in a release 😄

hassankhan avatar Nov 30 '17 21:11 hassankhan

Yeah, hard to balance something like this – a host isn't a URL, so I'm not sure it's really justified adding code to cover this edge case

mhart avatar Nov 30 '17 21:11 mhart

I somewhat agree, if the library shouldn't sanitise, then it could at least throw some sort of validation error?

hassankhan avatar Nov 30 '17 23:11 hassankhan