Is there a reason the response class checks for a Buffer specifically and not an instance of Uint8Array? #4852
Unanswered
andrew-connell
asked this question in
Help
Replies: 1 comment 1 reply
-
Hey @andrew-connell! 👋🏻 Can you make a PR with a test? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As per title. I'm still on v5 but v6 has basically the same code.
in getDataType in the Response class - Instead of
it works much better like
Because this will handle Uint8Arrays without having to convert to a Buffer. In my limited testing it works perfectly with this tiny change.
The use case being puppeteer having changed output to to Uint8Array instead of Buffer.
You can do Buffer.from(Uint8Array) but that seems very inefficient
Beta Was this translation helpful? Give feedback.
All reactions