fix: only add send ratelimited cookie if we are ratelimited
This commit is contained in:
parent
b5fda85147
commit
c951c74fde
@ -18,8 +18,9 @@ export const actions = {
|
|||||||
cookies.set("sendError", err.toString(), { path: "/guestbook" })
|
cookies.set("sendError", err.toString(), { path: "/guestbook" })
|
||||||
redirect(303, `${PUBLIC_BASE_URL}/guestbook/`)
|
redirect(303, `${PUBLIC_BASE_URL}/guestbook/`)
|
||||||
}
|
}
|
||||||
const ratelimited = respRaw.status === 429
|
if (respRaw.status === 429) {
|
||||||
cookies.set("sendRatelimited", ratelimited.toString(), { path: "/guestbook" })
|
cookies.set("sendRatelimited", "true", { path: "/guestbook" })
|
||||||
|
}
|
||||||
redirect(303, `${PUBLIC_BASE_URL}/guestbook/`)
|
redirect(303, `${PUBLIC_BASE_URL}/guestbook/`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user