fetch icon indicating copy to clipboard operation
fetch copied to clipboard

Add some missed methods which should be normalized as uppercase

Open aleen42 opened this issue 2 years ago • 2 comments

Recently I found that the polyfill for fetch() has not normalized the patch method as uppercase, and it seems like a bug like native implementation. Should we add some request methods to solve this problem?

REF: https://github.com/nodejs/help/issues/2184

aleen42 avatar Apr 01 '22 14:04 aleen42

Här är några tider som fungerar för mig:

söndag 3 april 2022

23:00 - 00:00 (GMT+2)

Enkelt med Outlookhttps://aka.ms/Dcupce

Hämta Outlook för Androidhttps://aka.ms/AAb9ysg


Från: Aleen @.> Skickat: fredag 1 april 2022 16:07 Till: github/fetch @.> Kopia: Subscribed @.***> Ämne: [github/fetch] Add some missed methods which should be normalized (PR #1119)

Recently I found that the polyfill for fetch() has not normalized the patch method as uppercase, and it seems like a bug like native implementation. Should we add some request methods to solve this problem?

REF: nodejs/help#2184https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnodejs%2Fhelp%2Fissues%2F2184&data=04%7C01%7C%7Cc43d9ca2724347bc125a08da13e8e3ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637844188209086913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2FuCzdMLOEmPHQKsgLKihKPLRus17DmdngfpGQXOyeHg%3D&reserved=0


You can view, comment on, or merge this pull request online at:

https://github.com/github/fetch/pull/1119https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgithub%2Ffetch%2Fpull%2F1119&data=04%7C01%7C%7Cc43d9ca2724347bc125a08da13e8e3ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637844188209086913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=bsfp19se0lgJXWHVt5pVrmfvKTTkmaSd3EAzMPuu47g%3D&reserved=0

Commit Summary

File Changes

(1 filehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgithub%2Ffetch%2Fpull%2F1119%2Ffiles&data=04%7C01%7C%7Cc43d9ca2724347bc125a08da13e8e3ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637844188209086913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=S%2FfInldp9zSsG2K27fusuzK9NTbVR70HFNuoR0vps64%3D&reserved=0)

Patch Links:

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgithub%2Ffetch%2Fpull%2F1119&data=04%7C01%7C%7Cc43d9ca2724347bc125a08da13e8e3ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637844188209243114%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=gY7GMYi0TkqnmL9uZqRcgfFTS6MAXxhCtGRFYFDa8zs%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAROOKRWD57LECRIQMSATN3TVC37IHANCNFSM5SIZXNPQ&data=04%7C01%7C%7Cc43d9ca2724347bc125a08da13e8e3ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637844188209243114%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=f4CKAYbxjoLnPziOLwkQPNTmqdVLxW381wpylZtx7p4%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

......................................................................................................................................... Join online meetinghttps://join.skype.com/kCMP4N3C5jvr .........................................................................................................................................

MsSwedenStudies avatar Apr 03 '22 21:04 MsSwedenStudies

fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fetch.js b/fetch.js index ce474a03..a2cbe7ad 100644 --- a/fetch.js +++ b/fetch.js @@ -329,7 +329,7 @@ function Body() { }

// HTTP methods whose capitalization should be normalized -var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] +var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']

function normalizeMethod(method) { var upcased = method.toUpperCase()

PandaSuits avatar Apr 10 '22 03:04 PandaSuits

@JakeChampion is it possible to have this be merged? This still exists as a problem and this PR solves it.

As an aside, is the API not being updated? Haven't seen an update in 2 years.

TimeTerminal avatar Mar 23 '23 19:03 TimeTerminal