Uh oh!
There was an error while loading. Please reload this page.
set request tokens on request made using fetch - #14943
Conversation
Signed-off-by: Robin Appelman <robin@icewind.nl>
There was a problem hiding this comment.
Headers are not a simple object. It's a constructor:
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Headers
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Supplying_request_options
myHeaders=newHeaders({"Content-Length": content.length.toString(),"X-Custom-Header": "ProcessThisImmediately",});myHeaders.append("Content-Type","text/plain");varmyInit={method: 'GET',headers: myHeaders,mode: 'cors',cache: 'default'};fetch('flowers.jpg',myInit)I don't know if forcing it to be an object like your implementation can lead to issues or not 🤔
There was a problem hiding this comment.
I'll also add that it's not available everywhere
https://caniuse.com/#feat=fetch
So like this it will initiate and create window.fetch even if fetch is not available, which can cause issues if any other software want to check if the browsers supports native fetch :)
rullzer
commented
Sep 15, 2019
we do not use fetch anywhere I think. And we don't (or will soon no longer) ship babel polyfill. So i'm not sure this is needed or useful? @ChristophWurst@skjnldsv |
skjnldsv
commented
Sep 16, 2019
Yeah, let's close I guess :) |
Signed-off-by: Robin Appelman robin@icewind.nl