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

HTTP2 ClientHttp2Stream support #891

Open
FStefanni opened this issue Oct 4, 2022 · 4 comments
Open

HTTP2 ClientHttp2Stream support #891

FStefanni opened this issue Oct 4, 2022 · 4 comments
Labels
Type: Documentation An Issue or Pull Request for improving or updating documentation.

Comments

@FStefanni
Copy link

FStefanni commented Oct 4, 2022

Support plan

  • which support plan is this issue covered by? (e.g. Community, Sponsor, or
    Enterprise): Community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: 18.0.6
  • module (formidable) version: 3.2.4
  • environment (e.g. node, browser, native, OS): node
  • used with (i.e. popular names of modules): custom
  • any other relevant information:

What problem are you trying to solve?

Hi,

I am using formidable with Typescript.
I have seen that the formidable.parse() method accepts http.IncomingMessage, which is fine for server side, and for HTTP1 client-side.
But client-side with HTTP2, it should also accept http2.ClientHttp2Stream.

So the questions/issues are:

  1. Can formidable work with also http2.ClientHttp2Stream? I suppose so, but the Typescript compiler complains... (before putting a brutal unsafe cast I want to be sure)
  2. If not, it would be nice to also support this use case
  3. Types definitions should be updated accordingly (also if already supported)

Regards

EDIT

Just seen that also http2.Http2ServerRequest makes the Typescript compiler complain. So even HTTP2 seems not explicitly supported. So definitely supporting HTTP2 would be a useful feature.

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

If as I suppose, formidable already supports the HTTP2 client side, the problem fix is just a matter of updating the types definitions of formidable.parse() to accept also a http2.ClientHttp2Stream (http.IncomingMessage | http2.ClientHttp2Stream).

@GrosSacASac
Copy link
Contributor

Thanks

@nagayev
Copy link
Collaborator

nagayev commented Oct 4, 2022

Thank you

@tunnckoCore tunnckoCore added the Type: Documentation An Issue or Pull Request for improving or updating documentation. label Dec 2, 2022
@tunnckoCore
Copy link
Member

@FStefanni I think it is supported too. We don't do much with the stream, we just get the headers - at least that's the very basic explanation of what Formidable is doing, haha. I guess it's the typings.

@FStefanni
Copy link
Author

Hi,

yes I also suppose (but I have not done a deep dive in the code) that its only a matter of typings.
So updating the types definitions could suffice and fix this issue.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation An Issue or Pull Request for improving or updating documentation.
Projects
None yet
Development

No branches or pull requests

4 participants