You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/12/13 22:28:04 UTC
svn commit: r604033 -
/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
Author: ivaynberg
Date: Thu Dec 13 13:28:01 2007
New Revision: 604033
URL: http://svn.apache.org/viewvc?rev=604033&view=rev
Log:
patch for usecase when header returns coma separated list
Modified:
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java?rev=604033&r1=604032&r2=604033&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java Thu Dec 13 13:28:01 2007
@@ -125,6 +125,15 @@
{
remoteAddr = httpServletReq.getRemoteAddr();
}
+ else
+ {
+ if (remoteAddr.indexOf(",") != -1)
+ {
+ // sometimes the header is of form client ip,proxy 1 ip,proxy 2 ip,...,proxy n ip,
+ // we just want the client
+ remoteAddr = remoteAddr.split(",")[0].trim();
+ }
+ }
return remoteAddr;
}