-
Notifications
You must be signed in to change notification settings - Fork 84
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 Gateway Payload V2: Multiple Headers with same name come as one #1861
Comments
we need to add a test to the core server TCK. Similar to micronaut-projects/micronaut-core#9791 @driverpt Do you want to contribute that PR to core? |
Hello, After some digging and Testing with AWS API Gateway Payload V2, I have discovered that If a header value contains a comma, it's appended "as is". i.e.:
A comma is widely used in most What is possibly needed is a Property that would tell the Request Converter not to split by comma in certain headers. WDYT @sdelamo @graemerocher @timyates ? @msailes , can you also provide some insights on this? |
I just check this with Micronaut Framework 4.2.0 Sending a request such as:
with a controller: package temp1;
import io.micronaut.http.HttpHeaders;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Controller("/headers")
public class HeadersController {
@Get
Map<String, List<String>> receiveMultipleHeaders(HttpRequest<?> request) {
return Collections.singletonMap("etag" , request.getHeaders().getAll(HttpHeaders.ETAG));
}
} we get response: HTTP/1.1 200 OK
Date: Fri, 24 Nov 2023 12:17:38 GMT
Content-Type: application/json
Content-Length: 16
Connection: close
Apigw-Requestid: O5wfYhZroAMEJlg=
{"etag":["A,B"]} I am going to close this issue for now. @driverpt let me know if you think we should do any changes about this. |
Expected Behavior
HttpRequest<?>
to return proper HeadersActual Behaviour
Returns same Header with values separated by Commas
Steps To Reproduce
Environment Information
Example Application
No response
Version
Latest with AWS 4.0.3
The text was updated successfully, but these errors were encountered: