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

Request fails when Array.prototype['pipe'] is defined #1825

Closed
pen-carpinelli opened this issue Dec 21, 2022 · 1 comment · Fixed by #1969
Closed

Request fails when Array.prototype['pipe'] is defined #1825

pen-carpinelli opened this issue Dec 21, 2022 · 1 comment · Fixed by #1969
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pen-carpinelli
Copy link

Bug Description

undici\lib\api\api-request.js line 54 throws an error if a custom pipe prototype for array is defined.

Reproducible By

  1. Define a custom pipe prototype for array:
    Array.prototype['pipe'] = function () { }

  2. Create a undici request with body being an array.

Expected Behavior

The request succeeds.

Logs & Screenshots

The request fails; the error body.on is not a function is thrown.

Environment

Windows 11

Additional context

@pen-carpinelli pen-carpinelli added the bug Something isn't working label Dec 21, 2022
@ronag
Copy link
Member

ronag commented Dec 21, 2022

Create a undici request with body being an array.

An array is not a valid body. So while the error might be better this should still fail.

@ronag ronag removed the bug Something isn't working label Dec 21, 2022
@ronag ronag added enhancement New feature or request good first issue Good for newcomers labels Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants