Like to add CSRF Filter recommended by OWASP Security Enhancement.
Can you please covert below Java Code in older version of Java. As I get error in i -> i.getName() where lambda is not supported in lower verion of Java and I am not able to compile in Eclipse
if (httpReq.getCookies() != null) { String csrfCookieExpectedName = this.determineCookieName(httpReq); tokenCookie = Arrays.stream(httpReq.getCookies()).filter( i -> i.getName().equals(csrfCookieExpectedName)).findFirst().orElse(null); for (int i = 0; i < httpReq.getCookies().length; i++) { if (httpReq.getCookies()[i].getName().equals(csrfCookieExpectedName))) { // return request.getCookies()[i]; } }
}
Complete Java Source Code is available in below link at the bottom of the page. http://ift.tt/1d4OIlG
Thanks in Advance, AGS
Aucun commentaire:
Enregistrer un commentaire