Skip to content

Fixing the queryStringParameters variable for ALB #182

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

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

proggeramlug
Copy link
Contributor

Adjusted the queryStringParameters to be actually working with ALB.

Motivation:

I want my Vapor apps to work through Lambda. However, this structure does not properly represent what AWS ALB is sending to the handler. There might be use-cases in which the original implementation is working but it looks fairly untested to me and I could not find the structure, as it is now, in any examples provided by AWS.

Modifications:

Change queryStringParameters from [String:[String]] to [String:String].

Result:

It works with the actual ALB (live example can be provided if desired) and I did not come across any need for the original implementation.

@swift-server-bot
Copy link

Can one of the admins verify this patch?

3 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@fabianfett
Copy link
Member

@swift-server-bot test this please

Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@proggeramlug thanks! I guess we should add the multiValueQueryStringParameters in a separate pr.

@proggeramlug
Copy link
Contributor Author

@fabianfett Do you have a specific use case for multiValueQueryStringParameters? I did not dig any deeper than my use-case required but I did not come across that specific parameter being passed.

@fabianfett
Copy link
Member

You can enable multiValueHeaders as documented by AWS. AFAIK if you enable multiValueHeaders the property be multiValueQueryStringParameters will be used instead of queryStringParameters. There is more documentation around multiValueHeaders.

Of course the current implementation doesn't work with either of those. So it's definitely a fix that should go in!

@fabianfett fabianfett merged commit ee2a6e0 into swift-server:main Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants