-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Patch patch cause the spec is weird #10216
Conversation
🦋 Changeset detectedLatest commit: ec14142 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -5899,6 +5899,47 @@ describe("a router", () => { | |||
expect((await request.formData()).get("query")).toBe("params"); | |||
}); | |||
|
|||
// https://fetch.spec.whatwg.org/#concept-method | |||
it("properly handles method=PATCH weirdness", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't fail (without the code fix) at the moment - I think our fetch polyfill is probably uppercasing all methods, so we should update that to force this test to be able to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e = _e; | ||
} | ||
expect(e).toMatchInlineSnapshot( | ||
`[Error: query()/queryRoute() requests must contain an AbortController signal]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've since fixed our Request
implementation to match the spec so it always has a signal. It's no longer possible to create one without a signal so altered these tests to just confirm that
Adding a
toUpperCase()
back that was removed in #10207 cause the spec is weird and doesn't uppercasepatch
: https://fetch.spec.whatwg.org/#concept-methodRelies on remix-run/web-std-io#30 before the unit test would actually fail otherwise