Skip to content

Commit

Permalink
fix: encode body of verify request
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 2, 2022
1 parent fed8c5e commit 51422d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/nitro/utils/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const endpoint = 'https://challenges.cloudflare.com/turnstile/v0/siteverify'
export const verifyTurnstileToken = async (token: string): Promise<TurnstileValidationResponse> => {
return await $fetch(endpoint, {
method: 'POST',
body: `secret=${secretKey}&response=${token}`,
body: `secret=${encodeURIComponent(secretKey)}&response=${encodeURIComponent(token)}`,
headers: {
'content-type': 'application/x-www-form-urlencoded',
},
Expand Down

0 comments on commit 51422d9

Please sign in to comment.