You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Omid Dehghan (Jira)" <ji...@apache.org> on 2019/10/11 15:22:00 UTC
[jira] [Created] (CAMEL-14059) camel-restlet can't send an array of
cookies at one response.
Omid Dehghan created CAMEL-14059:
------------------------------------
Summary: camel-restlet can't send an array of cookies at one response.
Key: CAMEL-14059
URL: https://issues.apache.org/jira/browse/CAMEL-14059
Project: Camel
Issue Type: Bug
Components: camel-restlet
Affects Versions: 3.0.0.RC2
Environment: Java 11 , Camel 3.0.0-RC2 , Camel-restlet-starter version 3.0.0-RC2
Reporter: Omid Dehghan
{color:#808080}I tried to send an array of cookies at once to the browser, but I'm getting this error: {color}
{color:#808080} java.io.IOException: Empty cookie name detected. Please check your cookies{color}
{color:#808080}But the same code without any changes works just fine with "jetty", "undertow","servlet" ... {color}
Parth of the code that I used for sending multiple cookies:
{color:#808080}
{color}{color:#000080}public {color}Order getOrder({color:#808000}@Headers {color}Map headers, {color:#808000}@ExchangeProperties {color}Map properties,Exchange exchange){
List<String> cookieList = {color:#000080}new {color}ArrayList<>();
cookieList.add({color:#008000}"Key7001=Value7001;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;"{color});
cookieList.add({color:#008000}"Key7002=Value7002;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;"{color});
{color:#808080}// Sets the two cookies on the browser
{color} headers.put({color:#008000}"Set-Cookie"{color},cookieList); {color:#808080}/// this will return an error saying java.io.IOException: Empty cookie name detected. Please check your cookies
{color}{color:#808080} //But the code above works just fine with Jetty and Undertow.
{color}{color:#808080}
{color}{color:#808080}
{color}{color:#808080} //Set with one cookie on the browser works just fine
{color}{color:#808080} //headers.put("Set-Cookie","Key6001=Value6001;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;");{color}
I uploaded the full code in github: https://github.com/odehghan/camelrestlet
--
This message was sent by Atlassian Jira
(v8.3.4#803005)