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

Don't assume fetchOptions has a body #384

Merged
merged 1 commit into from Sep 14, 2022
Merged

Don't assume fetchOptions has a body #384

merged 1 commit into from Sep 14, 2022

Conversation

kevinmcconnell
Copy link
Contributor

The event handler in encodeMethodIntoRequestBody was failing when forms were submitted using method="GET", because it assumed the presence of fetchOptions.body, and such forms don't have a body.

Checking for the presence of body before accessing it avoids the crash, and the resulting console noise.

@dhh
Copy link
Member

dhh commented Sep 14, 2022

Need to run yarn build and checkin the assets with changes 👍

The event handler in encodeMethodIntoRequestBody was failing when forms
were submitted using `method="GET"`, because it assumed the presence of
`fetchOptions.body`, and such forms don't have a body.

Checking for the presence of `body` before accessing it avoids the
crash, and the resulting console noise.
@kevinmcconnell
Copy link
Contributor Author

Just realised that too :) Thanks!

Clearly I've become too used to CI doing that sort of thing for me.

@dhh dhh merged commit fb519d5 into hotwired:main Sep 14, 2022
dhh added a commit that referenced this pull request Sep 19, 2022
* main:
  Don't assume fetchOptions has a `body` (#384)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants