Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed May 13, 2024
1 parent 1a5e44e commit ba8100c
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 14 deletions.
5 changes: 4 additions & 1 deletion fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
5 changes: 4 additions & 1 deletion fixtures/webstudio-custom-template/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
5 changes: 4 additions & 1 deletion fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
5 changes: 4 additions & 1 deletion fixtures/webstudio-remix-vercel/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/cli/templates/defaults/app/route-templates/html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const action = async ({

const submitTime = parseInt(formBotValue, 16);
// 5 minutes
if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) {
if (
Number.isNaN(submitTime) ||
Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
) {
throw new Error(`Form bot value invalid ${formBotValue}`);
}

Expand Down

0 comments on commit ba8100c

Please sign in to comment.