You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2014/08/19 12:51:59 UTC

[08/14] git commit: fix regression of Load Balancer Rewrites Location Headers Irrespective of Location Header URL Host

fix regression of Load Balancer Rewrites Location Headers Irrespective of Location Header URL Host


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/662f14d0
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/662f14d0
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/662f14d0

Branch: refs/heads/master
Commit: 662f14d05769b4c3431d30fe86fad4938723a7d0
Parents: 1e60645
Author: Udara Liyanage <ud...@wso2.com>
Authored: Mon Aug 18 14:50:52 2014 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Mon Aug 18 14:50:52 2014 +0530

----------------------------------------------------------------------
 .../load/balancer/mediators/LocationReWriter.java        | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/662f14d0/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/LocationReWriter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/LocationReWriter.java b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/LocationReWriter.java
index 50f08a3..02253ef 100644
--- a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/LocationReWriter.java
+++ b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/LocationReWriter.java
@@ -66,10 +66,15 @@ public class LocationReWriter extends AbstractMediator {
                     // Check whether the location host is an ip address of a known member
                     String hostname = LoadBalancerContext.getInstance().getMemberIpHostnameMap().get(inLocationUrl.getHost());
                     if (StringUtils.isEmpty(hostname)) {
-                        if (log.isDebugEnabled()) {
-                            log.debug(String.format("A hostname not found for ip: [ip-address] %s", inLocationUrl.getHost()));
+                        
+                        if (!LoadBalancerContext.getInstance().getHostNameClusterMap().containsCluster(inLocationUrl.getHost())) {
+                        	if (log.isDebugEnabled()) {
+                                log.debug(String.format("A hostname not found for ip: [ip-address] %s", inLocationUrl.getHost()));
+                            }
+                        	return;
+                        } else {
+                        	hostname = inLocationUrl.getHost();
                         }
-                        return;
                     }
 
                     if (log.isDebugEnabled()) {