Skip to content

fixed double-slash normalization #59

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

Merged
merged 1 commit into from
Aug 3, 2021
Merged

Conversation

twincitiesguy
Copy link
Contributor

this was being done by the apache client - fixed by swapping all // to /%2F (escaped second slash)

uriString = uriString.substring(0, doubleSlashIndex) + "/%2F" + uriString.substring(doubleSlashIndex + 2);
// replace double-slash with /%2f (otherwise apache client will normalize it to one slash)
if (path.contains("//")) {
if (scheme != null) uriString = uriString.substring(0, 8) + uriString.substring(8).replaceAll("//", "/%2F");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that path could be null by an unfriendly usage?
Will it work to process path before creating uri?

@xiaoxin-ren xiaoxin-ren merged commit eee15b9 into master Aug 3, 2021
@twincitiesguy twincitiesguy deleted the bugfix-double-slash branch August 3, 2021 16:33
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.

2 participants