Skip to content

Commit 91eef4b

Browse files
authored
Merge pull request #7 from ghostdevv/json
2 parents 435f71a + f2235bb commit 91eef4b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ async function validateToken(token: string, secret: string) {
7070
{
7171
method: 'POST',
7272
headers: {
73-
'content-type': 'application/x-www-form-urlencoded',
73+
'content-type': 'application/json',
7474
},
75-
body: new URLSearchParams({
75+
body: JSON.stringify({
7676
response: token,
7777
secret: secret,
78-
});
78+
}),
7979
},
8080
);
8181

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-turnstile",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"scripts": {
55
"dev": "vite dev",
66
"package": "svelte-kit sync && svelte-package",

src/routes/+page.server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ async function validateToken(token: string, secret: string) {
1313
{
1414
method: 'POST',
1515
headers: {
16-
'content-type': 'application/x-www-form-urlencoded',
16+
'content-type': 'application/json',
1717
},
18-
body: new URLSearchParams({
18+
body: JSON.stringify({
1919
response: token,
2020
secret: secret,
2121
}),

0 commit comments

Comments
 (0)