Affects: \spring-web-5.3.5

Using example URL below https://greenrockbatteries.com/_static/??-eJydkd1OwzAMRl+ILho/Q1wgXoB3QGniNu5SO4sdSnl6NjSBaIGqu4pifSdf5DOkyjEpkJoUS4skpgNN1u3NC5IzdcHoTQqsTOdj0yNtOrka5qjjOrLbi/EoarrvQWUJe6vIf5FiIx7vlbBDG0/oz8kE0wA9fGVOcQ2YfZVs1tF0hwJ53IAVpPYSsuciMASA5d6UkTPquKpGsyVBXcUMdkyMpLKK6tlDJnzPC3tPnLXhiDx94KitBXlm68H/Yv7/9sCvkPEzeYmGxpIba35b3SslQW5QwiKFNNMwXY3jDDOBXFyQAROc//bUP253N7f3d7vtw/UHBQJGkA==

Webclient throws error java.lang.IllegalArgumentException: Invalid character '=' for QUERY_PARAM in "=" platform-server | at org.springframework.web.util.HierarchicalUriComponents.verifyUriComponent(HierarchicalUriComponents.java:416) ~[spring-web-5.3.5.jar:5.3.5]

The URL is base64 encoded and padded at end with double equals. Removing one or both equals from URL, no error thrown.

Referenced https://github.com/spring-projects/spring-framework/blob/785212d67655119a71d3ad700e90c6e09e7c6361/spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java#L391

Comment From: rstoyanchev

base64 encoding a URL is not a strategy for creating a well formed URL. You need to encode URI components according to their individual rules and preserve the overall URI structure, so that proxies and servers can correctly parse the URL.

For more details on how to work with URI encoding, please refer to the reference docs: https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-uri-building.html#uri-encoding