-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decode query paramters for ALB event source (#545)
* decode ALB query strings
- Loading branch information
Showing
5 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
lambda-http/tests/data/alb_multi_value_request_encoded_query_parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"requestContext": { | ||
"elb": { | ||
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09" | ||
} | ||
}, | ||
"httpMethod": "GET", | ||
"path": "/", | ||
"queryStringParameters": { "myKey": "%3FshowAll%3Dtrue" }, | ||
"multiValueQueryStringParameters": { "myKey": ["%3FshowAll%3Dtrue", "%3FshowAll%3Dfalse"] }, | ||
"headers": { | ||
"accept": "text/html,application/xhtml+xml", | ||
"accept-language": "en-US,en;q=0.8", | ||
"content-type": "text/plain", | ||
"cookie": "name1=value1", | ||
"host": "lambda-846800462-us-east-2.elb.amazonaws.com", | ||
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)", | ||
"x-amzn-trace-id": "Root=1-5bdb40ca-556d8b0c50dc66f0511bf520", | ||
"x-forwarded-for": "72.21.198.66", | ||
"x-forwarded-port": "443", | ||
"x-forwarded-proto": "https" | ||
}, | ||
"multiValueHeaders": { | ||
"accept": ["text/html,application/xhtml+xml"], | ||
"accept-language": ["en-US,en;q=0.8"], | ||
"content-type": ["text/plain"], | ||
"cookie": ["name1=value1", "name2=value2"], | ||
"host": ["lambda-846800462-us-east-2.elb.amazonaws.com"], | ||
"user-agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)"], | ||
"x-amzn-trace-id": ["Root=1-5bdb40ca-556d8b0c50dc66f0511bf520"], | ||
"x-forwarded-for": ["72.21.198.66"], | ||
"x-forwarded-port": ["443"], | ||
"x-forwarded-proto": ["https"] | ||
}, | ||
"isBase64Encoded": false, | ||
"body": "request_body" | ||
} |
24 changes: 24 additions & 0 deletions
24
lambda-http/tests/data/alb_request_encoded_query_parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"requestContext": { | ||
"elb": { | ||
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09" | ||
} | ||
}, | ||
"httpMethod": "GET", | ||
"path": "/", | ||
"queryStringParameters": { "myKey": "%3FshowAll%3Dtrue"}, | ||
"headers": { | ||
"accept": "text/html,application/xhtml+xml", | ||
"accept-language": "en-US,en;q=0.8", | ||
"content-type": "text/plain", | ||
"cookie": "cookies", | ||
"host": "lambda-846800462-us-east-2.elb.amazonaws.com", | ||
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)", | ||
"x-amzn-trace-id": "Root=1-5bdb40ca-556d8b0c50dc66f0511bf520", | ||
"x-forwarded-for": "72.21.198.66", | ||
"x-forwarded-port": "443", | ||
"x-forwarded-proto": "https" | ||
}, | ||
"isBase64Encoded": false, | ||
"body": "request_body" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ async fn main() -> Result<(), Error> { | |
client.call(request).await | ||
} | ||
``` | ||
``` |