File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -729,15 +729,16 @@ component accessors="true" extends="coldbox.system.Interceptor" {
729
729
private function getRealIP (){
730
730
var headers = getHTTPRequestData ().headers ;
731
731
732
- // Very balanced headers
733
- if ( structKeyExists ( headers , " x-cluster-client-ip" ) ) {
734
- return headers [ " x-cluster-client-ip" ];
732
+ // When going through a proxy, the IP can be a delimtied list, thus we take the last one in the list
733
+
734
+ if ( structKeyExists ( headers , " x-cluster-client-ip" ) ){
735
+ return trim ( listLast ( headers [ " x-cluster-client-ip" ] ) );
735
736
}
736
- if ( structKeyExists ( headers , " X-Forwarded-For" ) ) {
737
- return headers [ " X-Forwarded-For" ];
737
+ if ( structKeyExists ( headers , " X-Forwarded-For" ) ){
738
+ return trim ( listFirst ( headers [ " X-Forwarded-For" ] ) ) ;
738
739
}
739
740
740
- return len ( CGI . REMOTE_ADDR ) ? trim ( listFirst ( CGI . REMOTE_ADDR ) ) : " 127.0.0.1" ;
741
+ return len ( cgi . remote_addr ) ? trim ( listFirst ( cgi . remote_addr ) ) : " 127.0.0.1" ;
741
742
}
742
743
743
744
/**
You can’t perform that action at this time.
0 commit comments