Closed nsteinmetz closed 6 years ago
Hi @nsteinmetz,
Good catch. I believe we have two options here:
Hi,
2nd option seems more logical/relevant for me - I will try to propose a fix this afternoon.
Nicolas
why not just do (naive approach)for line 98 :
result := strings.SplitN(v, ": ", 2)
As triming spaces is not really an option as we need to keep the space between Basic and the based64 encoded credentials.
Reading this https://flaviocopes.com/http-response-headers/ and https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields - the pattern seems always : <Key>: <value>
with value being almost everything possible
or
headers[result[0]] = strings.TrimLeft(result[1], " ")
What whould you prefer ?
I suggested both then in the PR :-)
The second option seems better since it allows people with or without the prefix white space.
Hi @maxcnunes
Testing the auth headers, I had a small issue:
I noticed there are 2 spaces between
Authorization
andBasic
in the debug output. So I changed for a no space version ie"Authorization:Basic
in the args and it works :I quickly reviewed the code and did not find where the issue may be.
Or it's only the doc to update ?
Thanks, Nicolas