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

Support Multi-Value Headers for ALB #64

Closed
atwoodjw opened this issue Jan 18, 2021 · 2 comments
Closed

Support Multi-Value Headers for ALB #64

atwoodjw opened this issue Jan 18, 2021 · 2 comments

Comments

@atwoodjw
Copy link
Contributor

Using the cookie-cutter app.rb w/ the ALB rack middleware, I'm seeing malformed responses. Looks like Lamby doesn't handle responses with multi-value headers. Works for me if I add the following, but I think it probably makes sense to fix the underlying issue.

def handler(event:, context:)
  result = Lamby.handler $app, event, context, rack: :alb

  # Lamby doesn't handle responses with multi-value headers.
  result[:multiValueHeaders]['Set-Cookie'] = result[:multiValueHeaders]['Set-Cookie'][0].split("\n")
  result.delete(:headers)

  result
end
@metaskills
Copy link
Member

Interesting, can you propose a fix to this file? https://github.com/customink/lamby/blob/master/lib/lamby/rack_alb.rb For example, is this multi_value? not returing true or false correctly? Or is it that we should add a line after here (https://github.com/customink/lamby/blob/master/lib/lamby/rack_alb.rb#L14) that does what you are proposing?

@metaskills
Copy link
Member

Thinking #75 fixes this and if not please re-open.

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

No branches or pull requests

2 participants