{"record":{"id":"c8f5e00fb1afdc1e","repo":"quarkusio/quarkus","slug":"should-have-comma","errorCode":null,"errorMessage":"should have comma","messagePattern":"should have comma","errorType":"http","errorClass":"RuntimeException","httpStatus":500,"severity":"info","filePath":"integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingResource.java","lineNumber":23,"sourceCode":"import jakarta.ws.rs.GET;\nimport jakarta.ws.rs.HeaderParam;\nimport jakarta.ws.rs.POST;\nimport jakarta.ws.rs.Path;\nimport jakarta.ws.rs.Produces;\nimport jakarta.ws.rs.core.Context;\nimport jakarta.ws.rs.core.MediaType;\n\nimport com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent;\n\n@Path(\"/hello\")\npublic class GreetingResource {\n\n    @GET\n    @Produces(MediaType.TEXT_PLAIN)\n    @Path(\"comma\")\n    public String comma(@HeaderParam(\"Access-Control-Request-Headers\") String access) {\n        if (access == null || !access.contains(\",\"))\n            throw new RuntimeException(\"should have comma\");\n        return \"ok\";\n    }\n\n    @GET\n    @Produces(MediaType.TEXT_PLAIN)\n    public String hello() {\n        return \"hello\";\n    }\n\n    @POST\n    @Produces(MediaType.TEXT_PLAIN)\n    @Consumes(MediaType.TEXT_PLAIN)\n    public String hello(String name) {\n        return \"hello \" + name;\n    }\n\n    @POST\n    @Produces(MediaType.APPLICATION_OCTET_STREAM)","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingResource.java#L5-L41","documentation":"GreetingResource.comma() is a CORS-related test endpoint in the amazon-lambda-http integration test. It requires the Access-Control-Request-Headers header to contain a comma; if the header is missing or has no comma it throws RuntimeException(\"should have comma\"). It verifies that multi-value headers survive the API Gateway -> Lambda HTTP event mapping.","triggerScenarios":"GET /hello/comma without an Access-Control-Request-Headers header, or with a single-value header containing no comma (e.g. \"content-type\" instead of \"content-type,authorization\").","commonSituations":"Testing CORS preflight header propagation through API Gateway; sending a preflight request with only one Access-Control-Request-Headers value; API Gateway or proxy stripping/collapsing multi-value headers.","solutions":["Send at least two values in Access-Control-Request-Headers, e.g. \"content-type,authorization\"","Check API Gateway/payload format (v1 vs v2) configuration so multi-value headers are not collapsed","Verify the client actually sends the CORS preflight header when hitting the endpoint"],"exampleFix":"// before\ncurl http://host/hello/comma -H \"Access-Control-Request-Headers: content-type\"   // fails\n// after\ncurl http://host/hello/comma -H \"Access-Control-Request-Headers: content-type,authorization\"   // \"ok\"","handlingStrategy":"validation","validationCode":"String access = request.getHeader(\"Access-Control-Request-Headers\");\nif (access == null || !access.contains(\",\")) {\n    // request will be rejected — add a second header value before calling\n}","typeGuard":null,"tryCatchPattern":"try {\n    String res = given().header(\"Access-Control-Request-Headers\", \"content-type,authorization\").get(\"/hello/comma\");\n} catch (RuntimeException e) {\n    if (\"should have comma\".equals(e.getMessage())) { /* fix headers */ }\n}","preventionTips":["Always send at least two values in Access-Control-Request-Headers for this endpoint","Verify API Gateway multi-value header passthrough is enabled","Check payload format version (v1/v2) preserves comma-separated header lists"],"tags":["http","headers","cors","test","api-gateway"],"backgroundTag":"missing-required-header","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}