Skip to content

Commit

Permalink
fix: bump rateLimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Aug 11, 2024
1 parent a4772ef commit 1c83a58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app.use(prettyJSON())
if (process.env.NODE_ENV === "production") {
app.use(rateLimiter({
windowMs: 1 * 60 * 1000, // 1 minutes
limit: 25,
limit: 150,
standardHeaders: "draft-6",
keyGenerator: (c) => {
return c.req.header('X-Forwarded-For') || c.req.header('X-Real-IP') || c.req.header('CF-Connecting-IP') || '127.0.0.1'
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const rateLimitMap = new Map()

const handleRateLimit: Handle = async ({ event, resolve }) => {
const ip = event.getClientAddress()
const limit = 100 // Requests per window
const limit = 150 // Requests per window
const windowMs = 60 * 1000 * 1 // minutes

if (!rateLimitMap.has(ip)) {
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/lib/components/image/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
<div
style="grid-template: 'container';"
class={cn(
"relative grid place-items-center flex-shrink-0 place-content-center overflow-hidden rounded-md border border-neutral-100 dark:border-neutral-800",
"md:w-64 w-48 max-h-36",
"relative grid flex-shrink-0 place-content-center place-items-center overflow-hidden rounded-md border border-neutral-100 dark:border-neutral-800",
"max-h-36 w-48 md:w-64",
className,
)}
>
<img
style="grid-area: container;"
class="object-cover w-full h-auto aspect-video rounded-md opacity-0 transition duration-500"
class="aspect-video h-auto w-full rounded-md object-cover opacity-0 transition duration-500"
class:srcImageLoaded={loaded}
use:onload
alt={alt ?? "Bookmark Image"}
Expand All @@ -59,7 +59,7 @@
style="grid-area: container;"
src={placeholderURL}
alt="Thumbhash Placeholder"
class="object-fill object-left-top rounded-md transition duration-500 pointer-events-none"
class="pointer-events-none h-full w-full rounded-md object-fill object-left-top transition duration-500"
class:loaded
/>
</div>
Expand Down

0 comments on commit 1c83a58

Please # to comment.