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

AWS Lambda Streaming only works with response bodies #2401

Closed
KnisterPeter opened this issue Mar 22, 2024 · 3 comments
Closed

AWS Lambda Streaming only works with response bodies #2401

KnisterPeter opened this issue Mar 22, 2024 · 3 comments
Labels

Comments

@KnisterPeter
Copy link
Contributor

What version of Hono are you using?

4.1.3

What runtime/platform is your app running on?

Node.js + AWS Lambda

What steps can reproduce the bug?

  • Create an app which just sends a redirect
  • Deploy that to lambda with the streaming API
  • It will not return the redirect

What is the expected behavior?

The Lambda streaming should respect responses without body.

What do you see instead?

The lambda only setup response metadata when a body is given.

Additional information

These are the lines in the code which are limiting and leading to the described behavior.

https://github.com/honojs/hono/blob/main/src/adapter/aws-lambda/handler.ts#L129-L134

If it's welcome I'll try to create a fix for it.

@yusukebe
Copy link
Member

Hi @KnisterPeter

Thank you for creating the issue.

The Lambda streaming should respect responses without body.

I see!

@watany-dev Could you see this issue?

@watany-dev
Copy link
Contributor

@KnisterPeter
Yes, you are correct, information on streamingResponse was scarce and only the bare minimum was implemented. I will gladly review your PR.

KnisterPeter added a commit to KnisterPeter/hono that referenced this issue Mar 25, 2024
In case of a streaming lambda, the response should still contain metadata
like status and content type, even if no body is given.
This could be for example a redirect response.
yusukebe pushed a commit that referenced this issue Mar 27, 2024
In case of a streaming lambda, the response should still contain metadata
like status and content type, even if no body is given.
This could be for example a redirect response.
@yusukebe
Copy link
Member

yusukebe commented Apr 9, 2024

This issue can be closed. Thanks!

@yusukebe yusukebe closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants