Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http method patch is case sensitive #254

Closed
kocur4d opened this issue Jan 7, 2016 · 3 comments
Closed

http method patch is case sensitive #254

kocur4d opened this issue Jan 7, 2016 · 3 comments

Comments

@kocur4d
Copy link

kocur4d commented Jan 7, 2016

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.
@kocur4d kocur4d changed the title method fetch is not a member of methods array method patch is case sensitive Jan 7, 2016
@kocur4d kocur4d changed the title method patch is case sensitive http method patch is case sensitive Jan 7, 2016
@dgraham
Copy link
Contributor

dgraham commented Jan 7, 2016

Unfortunately, it is intended. PATCH must be shouted in all caps. See #37 for more discussion.

@dgraham dgraham closed this as completed Jan 7, 2016
@kocur4d
Copy link
Author

kocur4d commented Jan 7, 2016

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...

jamesplease added a commit to jamesplease/fetch that referenced this issue Jan 31, 2016
HTTP methods are case-sensitive. The examples lead developers to
think that this API normalizes the method names to uppercase,
leading to issues like JakeChampion#37 and JakeChampion#254.

Setting the right precedent in the README will prevent developers
from making mistake of trying to use method: 'patch' (or any
other verb that isn't normalized for backwards compatibility).
jamesplease added a commit to jamesplease/fetch that referenced this issue Jan 31, 2016
HTTP methods are case-sensitive. The examples in the README currently
lead developers to think that this API normalizes all of the method
names to uppercase, leading to issues like JakeChampion#37 and JakeChampion#254.

Setting the right precedent in the README will prevent developers
from making mistake of trying to use method: 'patch' (or any
other verb that isn't normalized for backwards compatibility).
jamesplease added a commit to jamesplease/fetch that referenced this issue Jan 31, 2016
HTTP methods are case-sensitive. The examples in the README currently
lead developers to think that this API normalizes all of the method
names to uppercase, leading to issues like JakeChampion#37 and JakeChampion#254.

Setting the right precedent in the README will prevent developers
from making mistake of trying to use method: 'patch' (or any
other verb that isn't normalized for backwards compatibility).
@luca-aurelia
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants