-
Notifications
You must be signed in to change notification settings - Fork 494
Closed
Labels
bugThis issue is a bug.This issue is a bug.
Description
Hi,
We are seeing a problem when upgrading to the 3.x version of Amazon.Lambda.AspNetCoreServer with regards to query strings needing URL encoding twice. Take the following controller:
[Route("health")]
public class HealthController : Controller
{
public DateTimeOffset Index([FromQuery] DateTimeOffset testDateTimeOffset)
{
return testDateTimeOffset;
}
}Snippet from CloudFormation template for API gateway configuration:
"/{proxy+}": {
"x-amazon-apigateway-any-method": {
"x-amazon-apigateway-integration": {
"httpMethod": "POST",
"type": "aws_proxy",
"uri": { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ApiLambda.Arn}/invocations" }
}
}
}The request is sent to API Gateway, with an Asp.NET Lambda function behind it set as a proxy resource handling all requests.
| Version | /health?testDateTimeOffset={x} | Response |
|---|---|---|
| 3.x | 2019-03-12T16%3A06%3A06.5498170%2B00%3A00 | 0001-01-01T00:00:00+00:00 |
| 2.1.x | 2019-03-12T16%3A06%3A06.5498170%2B00%3A00 | 2019-03-12T16:06:06.549817+00:00 |
If we double encode the query parameter as 2019-03-12T16%253A06%253A06.5498170%252B00%253A00 with the 3.x package, the date time is as parsed correctly: 2019-03-12T16:06:06.549817+00:00.
This seems like incorrect behavior - single encoding should be enough as it was with 2.1.x.
Rutgerz, hvanbakel, rhettblanch and ozziepeeps
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.