undici icon indicating copy to clipboard operation
undici copied to clipboard

Implement fetch methods

Open ronag opened this issue 3 years ago • 8 comments

Under lib/fetch/util.js we have a few helper methods that are pretty well documented in spec and and needs to be implemented:

  • [ ] appendRequestOriginHeader
  • [ ] appendFetchMetadata
  • [ ] TAOCheck
  • [ ] corsCheck
  • [ ] crossOriginResourcePolicyCheck
  • [ ] makePolicyContainer
  • [ ] clonePolicyContainer
  • [ ] determineRequestsReferrer

ronag avatar Aug 14 '21 17:08 ronag

@szmarczak

ronag avatar Aug 14 '21 17:08 ronag

I'd like to help!

wong2 avatar Aug 17 '21 03:08 wong2

Though I have a question: do we need to implement those browser related features such as cors, content security policy in undici fetch?

wong2 avatar Aug 17 '21 03:08 wong2

Some of those are indeed only browser related, you can either implement them if possible or add a note explaining why we don't need to implement them and return a appropriate value or an assertion.

ronag avatar Aug 17 '21 06:08 ronag

I'd like to confirm what we think about cors related features, for example, mode is currently supported, while it's unimplemented in node-fetch. Do we want to support them as much as we can? Or are they unnecessary complexities?

wong2 avatar Aug 20 '21 08:08 wong2

Browser-related features might be useful when used with https://github.com/jsdom/jsdom but I don't have any use case for this.

szmarczak avatar Aug 20 '21 08:08 szmarczak

I'd like to confirm what we think about cors related features, for example, mode is currently supported, while it's unimplemented in node-fetch. Do we want to support them as much as we can? Or are they unnecessary complexities?

We implement them because it's easy to just follow the spec literally.

ronag avatar Aug 20 '21 09:08 ronag

It also supports isomorphic javascript.

btakita avatar Jan 23 '22 04:01 btakita

Hey there is it okay if I try to implement some of them? :D

Viper-space avatar Oct 28 '22 14:10 Viper-space

@KhafraDev is there anything left to implement?

ronag avatar Oct 28 '22 14:10 ronag

No, everything is done.

KhafraDev avatar Oct 28 '22 15:10 KhafraDev