Skip to content

Commit

Permalink
Added Owasp Encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
pjoshi31 committed Feb 23, 2024
1 parent f8f81b4 commit d72b7ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions surf/spring-surf/spring-surf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,10 @@
<artifactId>maven-artifact</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.owasp.encoder.Encode;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

Expand Down Expand Up @@ -159,7 +160,7 @@ protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpSer

try
{
response.getOutputStream().write(baos.toByteArray());
response.getOutputStream().write(Encode.forJava(baos.toString()).getBytes());
}
catch (IOException e)
{
Expand Down

0 comments on commit d72b7ca

Please sign in to comment.