Author: alessio.soldano(a)jboss.com
Date: 2009-12-04 12:23:37 -0500 (Fri, 04 Dec 2009)
New Revision: 11197
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
Log:
[JBWS-2849] Fixing cookies setup using headers
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2009-12-04
16:11:11 UTC (rev 11196)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2009-12-04
17:23:37 UTC (rev 11197)
@@ -47,6 +47,7 @@
import org.jboss.ws.core.client.EndpointInfo;
import org.jboss.ws.core.client.RemoteConnection;
import org.jboss.ws.core.client.RemoteConnectionFactory;
+import org.jboss.ws.core.client.transport.NettyClient;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.Style;
@@ -435,32 +436,36 @@
requestContext.put(SESSION_COOKIES, cookies);
}
- List<String> setCookies = new ArrayList<String>();
+ Map<String, Object> headers = (Map<String,
Object>)remotingMetadata.get(NettyClient.RESPONSE_HEADERS);
+ if (headers != null)
+ {
+ List<String> setCookies = new ArrayList<String>();
- List<String> setCookies1 =
(List)remotingMetadata.get("Set-Cookie");
- if (setCookies1 != null)
- setCookies.addAll(setCookies1);
+ List<String> setCookies1 = (List)headers.get("Set-Cookie");
+ if (setCookies1 != null)
+ setCookies.addAll(setCookies1);
- List<String> setCookies2 =
(List)remotingMetadata.get("Set-Cookie2");
- if (setCookies2 != null)
- setCookies.addAll(setCookies2);
+ List<String> setCookies2 = (List)headers.get("Set-Cookie2");
+ if (setCookies2 != null)
+ setCookies.addAll(setCookies2);
- // TODO: The parsing here should be improved to be fully compliant with the RFC
- for (String setCookie : setCookies)
- {
- int index = setCookie.indexOf(';');
- if (index == -1)
- continue;
+ // TODO: The parsing here should be improved to be fully compliant with the RFC
+ for (String setCookie : setCookies)
+ {
+ int index = setCookie.indexOf(';');
+ if (index == -1)
+ continue;
- String pair = setCookie.substring(0, index);
- index = pair.indexOf('=');
- if (index == -1)
- continue;
+ String pair = setCookie.substring(0, index);
+ index = pair.indexOf('=');
+ if (index == -1)
+ continue;
- String name = pair.substring(0, index);
- String value = pair.substring(index + 1);
+ String name = pair.substring(0, index);
+ String value = pair.substring(index + 1);
- cookies.put(name, value);
+ cookies.put(name, value);
+ }
}
}
Show replies by date