Giter VIP home page Giter VIP logo

Comments (4)

KhafraDev avatar KhafraDev commented on June 19, 2024 2

Especially as it feels pretty unique to multipart/form-data (at least for now).

It is unique to multipart/form-data, as without the boundary type provided in the content-type header, it can't be parsed.
https://datatracker.ietf.org/doc/html/rfc7578

"boundary" is now a required parameter in
Content-Type.

I would keep supporting it in request() and override it in fetch().

Here's where we'd implement the logic. I wonder if we should take a look at reimplementing a subset of forbidden headers as we've had nothing but issues (host header) and security vulnerabilities (cookie, authorization, proxy-authorization) by not implementing them. Originally I wanted to follow Deno's behavior, but I'm second guessing my judgement... I know ronag's disapproved removing them too, way back when.

https://github.com/nodejs/undici/blob/ae9587193403bccac4fdfe9ebc882c5240538cf3/lib/fetch/request.js#L507-509

from undici.

metcoder95 avatar metcoder95 commented on June 19, 2024

Agree with the statement that these scenarios should be handled by the users rather than undici or fetch doing its best guest to cover that up.

However, I'm a little over the fence if this is something that should be changed within undici or maybe a documentation improvement to be done. Especially as it feels pretty unique to multipart/form-data (at least for now).

Should we consider adding a documentation improvement and a possible warning before considering it to throw?
As said earlier, the only thing that it worries me is that this is becomes pretty specific to multipart/form-data only

from undici.

mcollina avatar mcollina commented on June 19, 2024

I would keep supporting it in request() and override it in fetch().

from undici.

mcollina avatar mcollina commented on June 19, 2024

IMHO those are needed for compat with the rest of the Node.js ecosystem.

SGTM on the implementation of in request.

from undici.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.