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

[WW-5370] Makes HttpParameters case-insensitive #807

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

lukaszlenart
Copy link
Member

Closes WW-5370

@lukaszlenart lukaszlenart changed the title WW-5370 Makes HttpParameters case-insensitive [WW-5370] Makes HttpParameters case-insensitive Dec 10, 2023
Copy link
Member

@yasserzamani yasserzamani left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

P.S. I'm not sure how much it's hard to implement but you might know better: Looks like that same functionality can be achieved with less code by replacing

final private Map<String, Parameter> parameters;

with

final private Map<String, Parameter> parameters = new TreeMap<String, Parameter>(String.CASE_INSENSITIVE_ORDER);

Or using Apache Commons CaseInsensitiveMap.

@kusalk
Copy link
Member

kusalk commented Dec 11, 2023

Yeah good call - would be better to change the underlying map to be one of the off-the-shelf implementations. The Apache Commons one probably makes more sense.

@lukaszlenart
Copy link
Member Author

Thanks for the ideas! I decided to use TreeMap as proposed by Yasser to avoid introducing another dependency (Commons Collection is used only in tests)

@asfgit asfgit force-pushed the feature/http-params-case branch from 7bea060 to 4eaab8a Compare December 12, 2023 08:48
Copy link

sonarcloud bot commented Dec 12, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

75.0% 75.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Member

@yasserzamani yasserzamani left a comment

Choose a reason for hiding this comment

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

Thank you Lukasz! 🙇

@lukaszlenart lukaszlenart merged commit f684eff into master Dec 12, 2023
9 of 10 checks passed
@lukaszlenart lukaszlenart deleted the feature/http-params-case branch December 12, 2023 09:26
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.

3 participants