Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Feb 7, 2024
1 parent 1fbbf64 commit abfc588
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export default styled(ButtonWithImage)`
overflow: hidden;
background: none;
color: #6c757d;
`;

// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public String updatecart(Model model, @RequestParam Map<String, String> params,
logger.info("session: " + this.sessionUser.getSessionId());
logger.info("jsession: " + this.sessionUser.getJSessionId());
logger.info("csrf: " + this.sessionUser.getCsrfToken());
logger.info("incoming arrAffinity: " + params.get("arrAffinity"));
logger.info("incoming arrAffinity: " + getCookieValue("ARRAffinity", request));

if(params.get("csrf") == null || !params.get("csrf").equals(this.sessionUser.getCsrfToken()))
{
Expand Down Expand Up @@ -95,7 +95,7 @@ public String viewcart(Model model, @RequestParam Map<String, String> params, Ht
logger.info("session: " + this.sessionUser.getSessionId());
logger.info("jsession: " + this.sessionUser.getJSessionId());
logger.info("csrf: " + this.sessionUser.getCsrfToken());
logger.info("incoming arrAffinity: " + params.get("arrAffinity"));
logger.info("incoming arrAffinity: " + getCookieValue("ARRAffinity", request));

if(params.get("csrf") == null || !params.get("csrf").equals(this.sessionUser.getCsrfToken()))
{
Expand Down Expand Up @@ -131,7 +131,7 @@ public String completecart(Model model, @RequestParam Map<String, String> params
logger.info("session: " + this.sessionUser.getSessionId());
logger.info("jsession: " + this.sessionUser.getJSessionId());
logger.info("csrf: " + this.sessionUser.getCsrfToken());
logger.info("incoming arrAffinity: " + params.get("arrAffinity"));
logger.info("incoming arrAffinity: " + getCookieValue("ARRAffinity", request));

if(params.get("csrf") == null || !params.get("csrf").equals(this.sessionUser.getCsrfToken()))
{
Expand Down Expand Up @@ -188,4 +188,20 @@ public String introspectionSimulation(Model model, HttpServletRequest request,
" \"exp\": 1911221039\n" +
"}";
}

private String getCookieValue(String cookieName, HttpServletRequest request) {
String foundCookieValue = null;
if(request.getCookies() != null)
{
for(int i = 0; i < request.getCookies().length; i++)
{
if(request.getCookies()[i].getName().equals(cookieName))
{
foundCookieValue = request.getCookies()[i].getValue();
break;
}
}
}
return foundCookieValue;
}
}

0 comments on commit abfc588

Please sign in to comment.