mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-26 15:12:47 -05:00
7 lines
214 B
JavaScript
7 lines
214 B
JavaScript
export function ensureValidURL(urlStr) {
|
|
const url = new URL(urlStr)
|
|
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
throw new Error(`rejecting attempt to load non-http URL '${urlStr}'`)
|
|
}
|
|
}
|