mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-28 16:02:49 -05:00
Require user-supplied URLs to be http protocol
This commit is contained in:
6
src/util.js
Normal file
6
src/util.js
Normal file
@@ -0,0 +1,6 @@
|
||||
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}'`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user