Skip to content
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

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

StefRe
Copy link
Contributor

@StefRe StefRe commented Mar 1, 2021

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).

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.
@raphaelm raphaelm merged commit b3d545d into opacapp:master Mar 26, 2021
@StefRe StefRe deleted the fix/cleanUrl_non-static branch March 26, 2021 20:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants