cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/3] cxf git commit: Strip out any query parameters when sending the applies to address
Date Thu, 12 Nov 2015 12:14:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/master ecc3acd1b -> 8cc10f615


Strip out any query parameters when sending the applies to address


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8cc10f61
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8cc10f61
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8cc10f61

Branch: refs/heads/master
Commit: 8cc10f615c37521d2943b8a8003529eeadef671b
Parents: c0d5427
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Nov 12 12:14:01 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Nov 12 12:14:30 2015 +0000

----------------------------------------------------------------------
 .../cxf/ws/security/trust/STSTokenRetriever.java       | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8cc10f61/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenRetriever.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenRetriever.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenRetriever.java
index 3b57bda..41556a7 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenRetriever.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenRetriever.java
@@ -136,9 +136,16 @@ public final class STSTokenRetriever {
 
                 Object o = SecurityUtils.getSecurityPropertyValue(SecurityConstants.STS_APPLIES_TO,
message);
                 String appliesTo = o == null ? null : o.toString();
-                appliesTo = appliesTo == null
-                    ? message.getContextualProperty(Message.ENDPOINT_ADDRESS).toString()
-                    : appliesTo;
+                if (appliesTo == null) {
+                    String endpointAddress = 
+                        message.getContextualProperty(Message.ENDPOINT_ADDRESS).toString();
+                    // Strip out any query parameters if they exist
+                    int query = endpointAddress.indexOf('?');
+                    if (query > 0) {
+                        endpointAddress = endpointAddress.substring(0, query);
+                    }
+                    appliesTo = endpointAddress;
+                }
                 boolean enableAppliesTo = client.isEnableAppliesTo();
 
                 client.setMessage(message);


Mime
View raw message