Skip to content

Commit

Permalink
chore(notifications): 1188 prevent retry on notification requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mmaul committed Jul 12, 2024
1 parent e251b82 commit 65e92eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frontend/src/app/modules/core/api/http-error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ export class HttpErrorInterceptor implements HttpInterceptor {
const escapedPattern = pattern.split('*').map(escapeRegExp).join('.*');
const regexPattern = `^${ escapedPattern }$`;
const regex = new RegExp(regexPattern);
const matches = regex.test(url);
return matches;
return regex.test(url);
}

// Helper method to strip base URL from the request URL
private stripBaseUrl(url: string): string {
const baseUrlPattern = /^(https?:\/\/[^\/]+)(\/.*)?$/;
const match = baseUrlPattern.exec(url);
return match && match[2] ? match[2] : url;
const baseUrlPattern = /^(https?:\/\/[^/]+)(\/.*)?$/;
return baseUrlPattern.exec(url)?.[2] ?? url;
}
}

Expand Down

0 comments on commit 65e92eb

Please sign in to comment.