OWASP / owasp-java-encoder

The OWASP Java Encoder is a Java 1.5+ simple-to-use drop-in high-performance encoder class with no dependencies and little baggage. This project will help Java web developers defend against Cross Site Scripting!
https://owasp.org/www-project-java-encoder/
BSD 3-Clause "New" or "Revised" License
493 stars 111 forks source link

Alternative method for deprecated forUri() method #54

Closed marjanovicstefan closed 3 months ago

marjanovicstefan commented 2 years ago

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> ENCODING_CHAIN_URL_IN_HTML_ATTRIBUTE = ImmutableList.of(Encode::forUri, EsEncode::uriAsSafeSchemeUri, Encode::forHtml);

Thanks!

jmanico commented 2 years ago

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