(url: string | undefined)
| 17 | } |
| 18 | |
| 19 | function getHostnameFromUrl(url: string | undefined): string[] { |
| 20 | if (!url) return [] |
| 21 | try { |
| 22 | return [`https://${new URL(url).hostname}`] |
| 23 | } catch { |
| 24 | return [] |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export interface CSPDirectives { |
| 29 | 'default-src'?: string[] |
no outgoing calls
no test coverage detected