I have an endpoint that receives a String from the client as seen below:
@GET
@Path(\"/{x}\")
public Response doSomething(@PathParam(\"x\") String x) {
Stri
HtmlUtils from spring-web
got the job done with:
HtmlUtils.htmlEscape(x)
Maven dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
in .Net framework > 4.0 use AntiXSS
AntiXssEncoder.HtmlEncode()