Question
5
Replies
359
Views

Mphasis
US
Posted: September 25, 2019
Last activity: September 26, 2019
Last activity: 26 Sep 2019 1:00 EDT
Closed
Solved
Getting X-FORWARDED-FOR details from Http Request
Hi,
I am trying to get the X-Forwarded-For header details from the user login request in my PRPC personal editions (Pega 8.1). I added the following code to ApplicationProfileSetup activity. I am getting the "request" as Null, hence it is not getting into the if condition. Can you any one suggest, what might be going wrong in the below code?
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest");
oLog.error ("TEST LOG");
if (request != null) {
String ivuser = request.getHeader("X-Forwarded-For");
oLog.error("This is the request header" + ivuser );
}
Thanks
Abdul Rasheed