Question

5
Replies
216
Views
AbdulRasheedS Member since 2019 2 posts
Mphasis
Posted: 1 year ago
Last activity: 1 year ago
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

Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn