Skip to content

Use utf-8 in ServerHttpBasicAuthenticationConverter #10911

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

Closed
wants to merge 2 commits into from

Conversation

frozenice
Copy link
Contributor

This changes ServerHttpBasicAuthenticationConverter to use utf-8 rather than the platform's default encoding, as per #10903.

  • use an explicit charset (utf-8)
  • remove useless argument to substring
  • add test with non-ASCII characters
  • rename test to use proper character name

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 25, 2022
@sjohnr sjohnr self-assigned this Mar 1, 2022
@sjohnr sjohnr added in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 1, 2022
@sjohnr
Copy link
Contributor

sjohnr commented Mar 8, 2022

Hi @frozenice. Apologies on the delay reviewing this. I'm working on a webinar that will be done this week and I will circle back next week!

Copy link
Contributor

@sjohnr sjohnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay @frozenice. Thanks for the discussion and the PR. I have a bit of feedback below.

@frozenice
Copy link
Contributor Author

Fixed the checkstyle errors. Btw the request parameter of org.springframework.security.web.server.authentication.ServerHttpBasicAuthenticationConverterTests#apply is not used.

sjohnr pushed a commit that referenced this pull request Mar 17, 2022
@sjohnr
Copy link
Contributor

sjohnr commented Mar 17, 2022

Thanks @frozenice! I've squashed your commits and this is now in main as 2b6bc5d. I have also added a small polish commit 946e24e to add javadoc, copyright year, and an additional test. I'll add this to the 5.7 release as well.

@sjohnr sjohnr closed this Mar 17, 2022
@sjohnr sjohnr added this to the 5.7.0-M3 milestone Mar 17, 2022
@sjohnr sjohnr added the type: breaks-passivity A change that breaks passivity with the previous release label Mar 17, 2022
sjohnr pushed a commit that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: breaks-passivity A change that breaks passivity with the previous release type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants