Question

5
Replies
272
Views
Abdul Rasheed Shaik (AbdulRasheedS)
Mphasis

Mphasis
US
AbdulRasheedS Member since 2019 2 posts
Mphasis
Posted: September 25, 2019
Last activity: September 26, 2019
Posted: 25 Sep 2019 0:30 EDT
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

Data Integration Java and Activities
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.