Repository: quarkusio/quarkus
Issue: AWS Lambda HTTP Content-Type is lost

## Describe the bug
Quarkus RestEasy AWS Lambda's Content-Types don't get returned by AWS API Gateway.

### Expected behavior
The content type returned by the API Gateway is the one set by RESTEasy (ie 'application/json' unless set otherwise via @Produces)

### Actual behavior
The content type is `text/plain`.

## To Reproduce

1. Generate the Amazon Lambda HTTP example at https://quarkus.io/guides/amazon-lambda-http
2. Delete the `GreetingVertx`, `GreetingFunction` and `GreetingServlet` classes, and modify the pom accordingly to remove the corrresponding dependencies
3. Modify `GreetingResource`. Change the `@Produces` annotation to `APPLICATION_JSON` (RestEasy defaults to `application/json` but at least like that it is explicit) and modify the returned String to be a valid piece of JSON
4. Build the native Lambda: `mvn clean install -DskipTests=true -Pnative -Dnative-image.docker-build=true`
5. Upload it to AWS: `aws lambda create-function --function-name mynativefunction --zip-file fileb://target/function.zip --handler not.used.in.provided.runtimei --runtime provided --role arn:aws:iam::1234567890123:role/MyAppropriateRole`
6. Create an API on the API Gateway:
  6.1. Create a new HTTP API
  6.2. Choose the lambda integration uploaded in 5
  6.3. Configure a `GET /hello` route
  6.4. Configure the `$default` stage and create the API
7. Copy the Invoke URL and invoke it: `wget -S https://abcdef.execute-api.zone.amazonaws.com/hello`

Inspect the content-type returned by the invocation - it is `text/plain` despite the content type being `application/json` in the `GreetingResource` class.

### Configuration
NA

### Screenshots
NA

## Environment (please complete the following information):

### Output of `uname -a` or `ver`
`Linux DESKTOP-GJJ95MV 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux`

### Output of `java -version`
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)

### GraalVM version (if different from Java)
NA

### Quarkus version or git rev
1.12.2.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)
```
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/rich/.sdkman/candidates/maven/current
Java version: 11.0.10, vendor: AdoptOpenJDK, runtime: /home/rich/.sdkman/candidates/java/11.0.10.hs-adpt
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.19.104-microsoft-standard", arch: "amd64", family: "unix"
```

## Additional context
I have managed to fix this locally by adding the following hacky code to the `msg instanceof HttpResponse` clause of the `LambdaHttpHandler` class. I will try to get a pull request done soon.

```java
final List<Entry<String, String>> entries = res.headers().entries();
final Map<String, String> responseHeaders = new HashMap<>();
for (final Iterator<Entry<String, String>> i = entries.iterator(); i.hasNext();) {
	final Entry<String, String> e = i.next();
	log.info(e.getKey() + " : " + e.getValue());
	responseHeaders.put(e.getKey(), e.getValue());
}
responseBuilder.setHeaders(responseHeaders);
```


Changed files:
integration-tests/amazon-lambda-http-resteasy/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java
integration-tests/amazon-lambda-http/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java

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 fa99269e88e..e747f23e2be 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
@@ -6,7 +6,10 @@
 import java.nio.channels.WritableByteChannel;
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
@@ -92,12 +95,21 @@ public void handleMessage(Object msg) {
                     HttpResponse res = (HttpResponse) msg;
                     responseBuilder.setStatusCode(res.status().code());
 
-                    Headers multiValueHeaders = new Headers();
-                    responseBuilder.setMultiValueHeaders(multiValueHeaders);
+                    final Map<String, String> headers = new HashMap<>();
+                    responseBuilder.setHeaders(headers);
                     for (String name : res.headers().names()) {
-                        for (String v : res.headers().getAll(name)) {
-                            multiValueHeaders.add(name, v);
+                        final List<String> allForName = res.headers().getAll(name);
+                        if (allForName == null || allForName.isEmpty()) {
+                            continue;
                         }
+                        final StringBuilder sb = new StringBuilder();
+                        for (Iterator<String> valueIterator = allForName.iterator(); valueIterator.hasNext();) {
+                            sb.append(valueIterator.next());
+                            if (valueIterator.hasNext()) {
+                                sb.append(",");
+                            }
+                        }
+                        headers.put(name, sb.toString());
                     }
                 }
                 if (msg instanceof HttpContent) {
@@ -122,7 +134,7 @@ public void handleMessage(Object msg) {
                 }
                 if (msg instanceof LastHttpContent) {
                     if (baos != null) {
-                        if (isBinary(((Headers) responseBuilder.getMultiValueHeaders()).getFirst("Content-Type"))) {
+                        if (isBinary(responseBuilder.getHeaders().get("Content-Type"))) {
                             responseBuilder.setIsBase64Encoded(true);
                             responseBuilder.setBody(Base64.getMimeEncoder().encodeToString(baos.toByteArray()));
                         } else {
diff --git a/integration-tests/amazon-lambda-http-resteasy/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java b/integration-tests/amazon-lambda-http-resteasy/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
index 62937980ccc..03f4a55cd48 100644
--- a/integration-tests/amazon-lambda-http-resteasy/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
+++ b/integration-tests/amazon-lambda-http-resteasy/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
@@ -44,7 +44,7 @@ private void testGetText(String path) {
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
         Assertions.assertEquals(body(out), "hello");
-        Assertions.assertTrue(out.getMultiValueHeaders().get("Content-Type").get(0).startsWith("text/plain"));
+        Assertions.assertTrue(out.getHeaders().get("Content-Type").startsWith("text/plain"));
     }
 
     private APIGatewayV2HTTPEvent request(String path) {
@@ -77,7 +77,7 @@ private void testPostText(String path) {
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
         Assertions.assertEquals(body(out), "hello Bill");
-        Assertions.assertTrue(out.getMultiValueHeaders().get("Content-Type").get(0).startsWith("text/plain"));
+        Assertions.assertTrue(out.getHeaders().get("Content-Type").startsWith("text/plain"));
     }
 
     @Test
@@ -92,7 +92,7 @@ public void testPostBinary() throws Exception {
         request.setIsBase64Encoded(true);
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
-        Assertions.assertEquals(out.getMultiValueHeaders().get("Content-Type").get(0),
+        Assertions.assertEquals(out.getHeaders().get("Content-Type"),
                 MediaType.APPLICATION_OCTET_STREAM);
         Assertions.assertTrue(out.getIsBase64Encoded());
         byte[] rtn = Base64.decodeBase64(out.getBody());
diff --git a/integration-tests/amazon-lambda-http/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java b/integration-tests/amazon-lambda-http/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
index ed8b602e925..afebdd73b5d 100644
--- a/integration-tests/amazon-lambda-http/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
+++ b/integration-tests/amazon-lambda-http/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaSimpleTestCase.java
@@ -58,7 +58,7 @@ private void testGetText(String path) {
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
         Assertions.assertEquals(body(out), "hello");
-        Assertions.assertTrue(out.getMultiValueHeaders().get("Content-Type").get(0).startsWith("text/plain"));
+        Assertions.assertTrue(out.getHeaders().get("Content-Type").startsWith("text/plain"));
     }
 
     private APIGatewayV2HTTPEvent request(String path) {
@@ -93,7 +93,7 @@ private void testPostText(String path) {
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
         Assertions.assertEquals(body(out), "hello Bill");
-        Assertions.assertTrue(out.getMultiValueHeaders().get("Content-Type").get(0).startsWith("text/plain"));
+        Assertions.assertTrue(out.getHeaders().get("Content-Type").startsWith("text/plain"));
     }
 
     @Test
@@ -108,7 +108,7 @@ public void testPostBinary() throws Exception {
         request.setIsBase64Encoded(true);
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
-        Assertions.assertEquals(out.getMultiValueHeaders().get("Content-Type").get(0),
+        Assertions.assertEquals(out.getHeaders().get("Content-Type"),
                 MediaType.APPLICATION_OCTET_STREAM);
         Assertions.assertTrue(out.getIsBase64Encoded());
         byte[] rtn = Base64.decodeBase64(out.getBody());
@@ -138,7 +138,7 @@ public void testFunqy(String path) {
         APIGatewayV2HTTPResponse out = LambdaClient.invoke(APIGatewayV2HTTPResponse.class, request);
         Assertions.assertEquals(out.getStatusCode(), 200);
         Assertions.assertEquals(body(out), "\\"Make it funqy Bill\\"");
-        Assertions.assertTrue(out.getMultiValueHeaders().get("Content-Type").get(0).startsWith("application/json"));
+        Assertions.assertTrue(out.getHeaders().get("Content-Type").startsWith("application/json"));
     }
 
     @Test