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

Screen returned streams for setup errors #4204

Open
kanongil opened this issue Dec 4, 2020 · 0 comments
Open

Screen returned streams for setup errors #4204

kanongil opened this issue Dec 4, 2020 · 0 comments
Labels
feature New functionality or improvement

Comments

@kanongil
Copy link
Contributor

kanongil commented Dec 4, 2020

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: any
  • module version: 20.0.3
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information:

What problem are you trying to solve?

Improved error response to initial stream response errors, as reported in #4199. Currently the connection is just forcefully disconnected.

Do you have a new or modified API suggestion to solve the problem?

Always waiting for a 'readable' event before sending the headers is probably not something that we want to do, since it can delay sending the response headers, but it could work wonders as a (potentially default) option.

I don't know where this option would go, as it should probably be able to be specified inside the handler logic, and h.response() does not provide for options.

Come to think of it, it could just be added as a new toolkit method on h. Maybe h.stream(stream, { immediate: false }), similar to how inert provides a h.file(). Or it could be provided as a property on the stream object, like stream.statusCode.

@kanongil kanongil added the feature New functionality or improvement label Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

1 participant