Fetch: http method patch is case sensitive

Created on 8 Jan 2016  路  3Comments  路  Source: github/fetch

Is this intended?

https://github.com/github/fetch/blob/master/fetch.js#L200

method patch is not the member of the array.

spend some time till I figure out why my fetch was throwing:

Fetch API cannot load http://localhost:3000/api/v1/tasks. Method patch is not allowed by Access-Control-Allow-Methods in preflight response.

Most helpful comment

What do do you think of logging a warning when fetch is called with lowercase http verbs? Just dropped over an hour on what seemed like a very mysterious bug.

All 3 comments

Unfortunately, it is intended. PATCH must be shouted in all caps. See https://github.com/github/fetch/issues/37 for more discussion.

ah I don't know how I missed this issue...

Anyway it might be worth to add a small paragraph to the readme I literally spend an hour on this - but on the other hand I missed the issue #37 and didn't check source earlier...

What do do you think of logging a warning when fetch is called with lowercase http verbs? Just dropped over an hour on what seemed like a very mysterious bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hannesvdvreken picture hannesvdvreken  路  4Comments

indranildutta06 picture indranildutta06  路  3Comments

gkatsanos picture gkatsanos  路  4Comments

huanghaiyang picture huanghaiyang  路  3Comments

codeashian picture codeashian  路  3Comments