diff --git a/extensions/amazon-lambda-http/http-event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockHttpEventServer.java b/extensions/amazon-lambda-http/http-event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockHttpEventServer.java index e7b438422ea0c..69fe6e67955fe 100644 --- a/extensions/amazon-lambda-http/http-event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockHttpEventServer.java +++ b/extensions/amazon-lambda-http/http-event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockHttpEventServer.java @@ -128,6 +128,11 @@ public void processResponse(RoutingContext ctx, RoutingContext pending, Buffer b } } } + if (res.getCookies() != null) { + for (String cookie : res.getCookies()) { + response.headers().add("set-cookie", cookie); + } + } response.setStatusCode(res.getStatusCode()); String body = res.getBody(); if (body != null) { diff --git a/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java b/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java index c7c9b7f10920b..8b5c2654937cd 100644 --- a/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java +++ b/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java @@ -108,6 +108,11 @@ public void handleMessage(Object msg) { if (allForName == null || allForName.isEmpty()) { continue; } + // Handle cookies separately to preserve commas in the header values + if ("set-cookie".equals(name)) { + responseBuilder.setCookies(allForName); + continue; + } final StringBuilder sb = new StringBuilder(); for (Iterator valueIterator = allForName.iterator(); valueIterator.hasNext();) { sb.append(valueIterator.next());