owasp-java-encoder icon indicating copy to clipboard operation
owasp-java-encoder copied to clipboard

Alternative method for deprecated forUri() method

Open marjanovicstefan opened this issue 3 years ago • 1 comments
trafficstars

Hi,

I want to replace Encode::forUri with something that is not depricated. Does anyone know what method should I use to cover that up? I can't use forUriComponent() because I have to convert an link, not a query, and also forUriComponent() doesn't convert all the characters as forUri() did

Code example: private static final ImmutableList<UnaryOperator<String>> ENCODING_CHAIN_URL_IN_HTML_ATTRIBUTE = ImmutableList.of(Encode::forUri, EsEncode::uriAsSafeSchemeUri, Encode::forHtml);

Thanks!

marjanovicstefan avatar Jan 31 '22 09:01 marjanovicstefan

forURL ? No one really uses URI anymore that was just Jeff :)

jmanico avatar Mar 08 '22 14:03 jmanico