File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { PageServerLoad } from './$types';
44
55const rates = {
66 IP : [ 3 , 'm' ] satisfies Rate ,
7- IPUA : [ 1 , '15s ' ] satisfies Rate
7+ IPUA : [ 1 , '5s ' ] satisfies Rate
88} ;
99
1010const limiter = new RetryAfterRateLimiter ( { rates } ) ;
@@ -20,7 +20,10 @@ export const actions = {
2020 event . setHeaders ( {
2121 'Retry-After' : status . retryAfter . toString ( )
2222 } ) ;
23- return fail ( 429 , { retryAfter : status . retryAfter } ) ;
23+ return fail ( 429 , {
24+ reason : status . reason ,
25+ retryAfter : status . retryAfter
26+ } ) ;
2427 }
2528 return { retryAfter : 0 } ;
2629 }
Original file line number Diff line number Diff line change 1212 );
1313 const statusMessage = $derived (
1414 isLimited && currentForm ?.retryAfter // Ensure currentForm and retryAfter are defined
15- ? ` You are rate limited, retry in ${currentForm .retryAfter } seconds. `
15+ ? ` You are rate limited due to ${ currentForm . reason } , retry in ${currentForm .retryAfter } seconds. `
1616 : ' OK'
1717 );
1818
You can’t perform that action at this time.
0 commit comments