-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: add Content-Type
header for POST
requests made by enhance
#12198
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: add Content-Type
header for POST
requests made by enhance
#12198
Conversation
🦋 Changeset detectedLatest commit: a0d82a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This is my first PR here so I'm sorry for any imperfections it might have 😅 I am not sure i got the changelog done right... besides that i think that the code is ready to be reviewed by a team member. |
Might want to also check why the ubuntu chromium tests are failing. |
Content-Type
header for POST
requests made by enhance
Content-Type
header for POST
requests made by enhance
…ctions/enhance/` test page
298384b
to
b62aa34
Compare
… set `application/x-www-form-urlencoded` as a default `Content-Type` for `POST` requests made by `enhance`
b62aa34
to
e48e31e
Compare
@eltigerchino i've fixed up the tests for |
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
packages/kit/test/apps/basics/src/routes/actions/enhance/+page.server.js
Outdated
Show resolved
Hide resolved
packages/kit/test/apps/basics/src/routes/actions/enhance/+page.server.js
Outdated
Show resolved
Hide resolved
packages/kit/test/apps/basics/src/routes/actions/enhance/+page.svelte
Outdated
Show resolved
Hide resolved
packages/kit/test/apps/basics/src/routes/actions/enhance/+page.server.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
…type` / `formenctype`
…nctype-in-progressive-enhancement
Thank you so much! This should be good to merge once CI passes (might need a few retries for the other flaky tests). |
This PR introduces passing the
<form>
'senctype
value orformSubmitter
'sformenctype
value toContent-Type
header forPOST
request made when executing theuse:enhance
function and a default1 value ofapplication/x-www-form-urlencoded
when the<form>
element doesn't have theenctype
attribute specified or has an invalid value2 provided.When the
enctype
orformenctype
is set tomultipart/form
then we don't provide theContent-Type
header forfetch
requestClose #1936
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test:kit
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits
Footnotes
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/enctype ↩
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-attributes ↩