HTTP2 ClientHttp2Stream support

Open
#891 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
api, backend

Research direction

Start by inspecting formidable.parse() and its TypeScript definitions to determine how IncomingMessage is typed and whether HTTP/2 streams are handled at runtime. Check the existing project tests or type-checking setup for coverage of HTTP/2 inputs. Done means the relevant HTTP/2 request types are accepted without unsafe casts and multipart parsing behavior is verified.

Written by the indexing model from the issue text.

Description

Type: Documentation
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).

Dominant language
JavaScript
Stars
7.2k
Forks
689
Avg merge
3d 7h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from node-formidable/formidable

All issues in node-formidable/formidable

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.