Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14059

camel-restlet can't send an array of cookies at once for responce

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0.RC2
    • Fix Version/s: None
    • Component/s: camel-restlet
    • Labels:
      None
    • Environment:

      Java 11 , Camel 3.0.0-RC2 , Camel-restlet-starter version 3.0.0-RC2

    • Estimated Complexity:
      Unknown

      Description

      I tried to send an array of cookies at once to the browser, but I'm getting this error:

      java.io.IOException: Empty cookie name detected. Please check your cookies

       

      But the same code without any changes works just fine with "jetty", "undertow","servlet" ...

       

      Parth of the code that I used for sending multiple cookies:

      public Order getOrder(@Headers Map headers, @ExchangeProperties Map properties,Exchange exchange){

      List<String> cookieList = new ArrayList<>();
      cookieList.add("Key7001=Value7001;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;");
      cookieList.add("Key7002=Value7002;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;");

      // Sets the two cookies on the browser

      headers.put("Set-Cookie",cookieList); /// this will return an error saying java.io.IOException: Empty cookie name detected. Please check your cookies

      //Set with one cookie on the browser works just fine

      //headers.put("Set-Cookie","Key6001=Value6001;Path=/;HttpOnly=true;session-token=test;Expires=Thu, 06-Jan-2022 00:00:00 GMT;");

       

      I uploaded the full code in github: https://github.com/odehghan/camelrestlet

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                odehghan Omid Dehghan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: