Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] API GW V2 Payload setting same header on Single and MultiValue #1858

Closed
driverpt opened this issue Aug 30, 2023 · 7 comments · May be fixed by #1859
Closed

[Bug] API GW V2 Payload setting same header on Single and MultiValue #1858

driverpt opened this issue Aug 30, 2023 · 7 comments · May be fixed by #1859
Assignees
Labels
closed: notabug The issue is not a bug

Comments

@driverpt
Copy link
Contributor

Expected Behavior

If multiple, then set multiValueHeaders

Actual Behaviour

Sets both headers and multiValueHeaders

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.0.3

@sdelamo
Copy link
Contributor

sdelamo commented Sep 1, 2023

do you have a link to AWS documentation about how single and multi behave?

@driverpt
Copy link
Contributor Author

driverpt commented Sep 1, 2023

Even though its not documented, this is still used by AWS Libraries:

https://github.com/aws/aws-lambda-go/blob/main/events/apigw.go#L125-L132

@sdelamo
Copy link
Contributor

sdelamo commented Sep 20, 2023

I tried this in the AWS Console today.

 * GET /prod/ HTTP/1.1
     * Key: value1,value2,value3
     * Foo: Bar

AWS instantiates :

        APIGatewayProxyRequestEvent request = new APIGatewayProxyRequestEvent()
        Map<String, String> headers = new HashMap<>()
        headers.put("Foo", "Bar")
        headers.put("Key", "value1,value2,value3")
        request.setHeaders(headers)
        Map<String, List<String>> multiValueHeaders = new HashMap<>()
        multiValueHeaders.put("Key", Arrays.asList("value1", "value2", "value3"))
        multiValueHeaders.put("Foo", Collections.singletonList("Bar"))
        request.setMultiValueHeaders(multiValueHeaders)

Thus, I think the current behavior is ok.

@sdelamo sdelamo added the closed: notabug The issue is not a bug label Sep 20, 2023
@driverpt
Copy link
Contributor Author

This issue is about the response

@sdelamo
Copy link
Contributor

sdelamo commented Sep 22, 2023

@driverpt what do you mean by the response? Are you not getting every header set in the micronaut HTTP response in the api gateway response ?

@sdelamo sdelamo moved this to Todo in 4.1.3 Release Sep 22, 2023
@sdelamo sdelamo self-assigned this Sep 22, 2023
@sdelamo sdelamo removed this from 4.1.3 Release Sep 29, 2023
@sdelamo sdelamo removed this from 4.1.5 Release Oct 18, 2023
@sdelamo sdelamo added this to 4.1.6 Oct 18, 2023
@timyates
Copy link
Contributor

timyates commented Nov 6, 2023

I'm going to close this for now, please open a new issue if you believe this is in error 👍

@timyates timyates closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@github-project-automation github-project-automation bot moved this to Done in 4.1.6 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: notabug The issue is not a bug
Projects
No open projects
Status: Done
3 participants