fix: redirect code

This commit is contained in:
Cory Dransfeldt 2024-07-26 18:12:28 -07:00
parent 89813e6691
commit 0754a715ed
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "20.13.0", "version": "20.13.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "20.13.0", "version": "20.13.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@cdransf/api-text": "^1.4.0", "@cdransf/api-text": "^1.4.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "20.13.0", "version": "20.13.1",
"description": "The source for my personal site. Built using 11ty (and other tools).", "description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module", "type": "module",
"scripts": { "scripts": {

View file

@ -14,7 +14,7 @@ export default {
const submissions = ipSubmissions.get(ip).filter(time => currentTime - time < TIME_FRAME) const submissions = ipSubmissions.get(ip).filter(time => currentTime - time < TIME_FRAME)
if (submissions.length >= RATE_LIMIT) return Response.redirect('https://coryd.dev/rate-limit', 429) if (submissions.length >= RATE_LIMIT) return Response.redirect('https://coryd.dev/rate-limit', 301)
submissions.push(currentTime) submissions.push(currentTime)
ipSubmissions.set(ip, submissions) ipSubmissions.set(ip, submissions)