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

Remove leading/trailing whitespaces from rendered authorization header #2900

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

kyri-petrou
Copy link
Collaborator

/fixes #2742
/claim #2742

Seems that Netty doesn't like the leading whitespace in the Authorization header, which is causing the client to hang

@gaeljw
Copy link

gaeljw commented Jun 10, 2024

Interesting, could it be an issue in Netty then? Maybe worth letting them know?

@987Nabil
Copy link
Contributor

@kyri-petrou is line 1064 not a problem too? We split by space and then scheme is index 0 of that array. But if there is no scheme, index 0 would be params not scheme. For the stringification, I think it does not matter. But the Unparsed instance would be wrong or? I think if the splitted result has size one, scheme should be empty.

@kyri-petrou
Copy link
Collaborator Author

@kyri-petrou is line 1064 not a problem too? We split by space and then scheme is index 0 of that array. But if there is no scheme, index 0 would be params not scheme. For the stringification, I think it does not matter. But the Unparsed instance would be wrong or? I think if the splitted result has size one, scheme should be empty.

Good points. I did the following:

  1. Removed any empty strings from the array after splitting on " "
  2. Parsing a single non-empty string to Unparsed("", value)
  3. Otherwise parse the first value as the scheme and then the rest as previously

@987Nabil 987Nabil merged commit d1cb10d into zio:main Jun 11, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Header.Authorization.Unparsed with empty authScheme cause code to hang forever
3 participants