( url: string, allowedOrigin: string )
| 246 | } |
| 247 | |
| 248 | export function validatePaginationUrl( |
| 249 | url: string, |
| 250 | allowedOrigin: string |
| 251 | ): boolean { |
| 252 | try { |
| 253 | const parsed = new URL(url); |
| 254 | const allowed = new URL(allowedOrigin); |
| 255 | return parsed.origin === allowed.origin; |
| 256 | } catch { |
| 257 | return false; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | // Rename archive to add extension because after downloading |
| 262 | // archive does not contain extension type and it leads to some issues |
no outgoing calls
no test coverage detected