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

fix: don't uppercase unknown methods #1542

Merged
merged 3 commits into from Apr 28, 2022

Conversation

lynxtaa
Copy link
Contributor

@lynxtaa lynxtaa commented Apr 25, 2022

Purpose

The purpose is to follow Fetch Spec

Changes

As per spec:
To normalize a method, if it is a byte-case-insensitive match for DELETE, GET, HEAD, OPTIONS, POST, or PUT, byte-uppercase it.


  • I updated readme
  • I added unit test(s)

@jimmywarting
Copy link
Collaborator

Could you also create a test case for this?

@lynxtaa
Copy link
Contributor Author

lynxtaa commented Apr 27, 2022

Could you also create a test case for this?

I've tried but I'm not sure how can I check if requested method was uppercased or not. In tests res.method is undefined. Could you help me with this?

@lynxtaa
Copy link
Contributor Author

lynxtaa commented Apr 27, 2022

Added tests

Copy link
Member

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! 👍

@jimmywarting jimmywarting merged commit 004b3ac into node-fetch:main Apr 28, 2022
@github-actions
Copy link

🎉 This PR is included in version 3.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jimmywarting
Copy link
Collaborator

thank you @lynxtaa

@lynxtaa lynxtaa deleted the no-uppercase-for-unknown branch April 28, 2022 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

non-standard HTTP methods are not uppercased by Chrome
3 participants