honojs / node-server

Node.js Server for Hono
https://hono.dev
370 stars 44 forks source link

Update Request to work with ReadableStream polyfills #164

Closed nicksrandall closed 5 months ago

nicksrandall commented 5 months ago

Some web frameworks (like Remix) inject polyfills for ReadableStream into the Node Runtime. This change makes sure that the server will work correctly with those polyfills. Otherwise the instanceof check would fail.

nicksrandall commented 5 months ago

More info on Remix Polyfills:

I borrowed this check from the polyfill implementation here:

yusukebe commented 5 months ago

Hi @nicksrandall !

Thanks for the PR. It looks good to me. One thing, could you run yarn format:fix && yarn lint:fix to fix the format?

nicksrandall commented 5 months ago

@yusukebe Done

yusukebe commented 5 months ago

@nicksrandall Thanks! Merging now.