This repository has been archived by the owner on Dec 25, 2024. It is now read-only.
Make cleanUrl non-static so that APIs can overwrite it #614
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cleanUrl replaces missing values in key-value-pairs with an empty string so that
?param&... becomes ?param=&... . This may lead to problems in some cases (e.g.
at SLUBApi when resolving libero references in getDetailById). Even it we'd
replace the "" by null in the else branch of the current implementation, a
trailing = will still be be added by URLEncodedUtils.format, as Android uses
httpclient-android version 4.3.5.1 which has a bug to add a trailing = sign
to key-only parameters by replacing missing parameters with empty strings the
same way clearUrl does (versions 4.5 and newer work correctly but can't be
used by Android, see also https://hc.apache.org/httpcomponents-client-4.5.x/android.html.
To avoid this we make cleanUrl non-static so that APIs can overwrite
it with their own version as needed.
This is a follow-up PR to #612 as discussed in #612 (comment).