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

Patch patch cause the spec is weird #10216

Merged
merged 2 commits into from
Mar 17, 2023
Merged

Patch patch cause the spec is weird #10216

merged 2 commits into from
Mar 17, 2023

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Mar 16, 2023

Adding a toUpperCase() back that was removed in #10207 cause the spec is weird and doesn't uppercase patch: https://fetch.spec.whatwg.org/#concept-method

Relies on remix-run/web-std-io#30 before the unit test would actually fail otherwise

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2023

🦋 Changeset detected

Latest commit: ec14142

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@remix-run/router Patch
react-router Patch
react-router-dom Patch
react-router-dom-v5-compat Patch
react-router-native Patch

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 () => {
Copy link
Contributor Author

@brophdawg11 brophdawg11 Mar 16, 2023

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

Copy link
Contributor Author

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]`
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants