Skip to content

Commit

Permalink
fix parsing undefined for 429
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Jan 21, 2025
1 parent bb289d2 commit b668a13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function extractTooManyRequestsInfo(html: string) {
const ip = html.match(/IP address: (.+?)<br>/)?.[1] || '';
const time = html.match(/Time: (.+?)<br>/)?.[1] || '';
const url = (html.match(/URL: (.+?)<br>/)?.[1] || '').replace(/&amp;/g, '&');
export function extractTooManyRequestsInfo(html: string | undefined) {
const ip = html?.match(/IP address: (.+?)<br>/)?.[1] || '';
const time = html?.match(/Time: (.+?)<br>/)?.[1] || '';
const url = (html?.match(/URL: (.+?)<br>/)?.[1] || '').replace(/&amp;/g, '&');
return { ip, time, url };
}

0 comments on commit b668a13

Please sign in to comment.