MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / isValidUrl

Function isValidUrl

packages/components/src/modelLoader.ts:22–30  ·  view source on GitHub ↗
(urlString: string)

Source from the content-addressed store, hash-verified

20}
21
22const isValidUrl = (urlString: string) => {
23 let url
24 try {
25 url = new URL(urlString)
26 } catch (e) {
27 return false
28 }
29 return url.protocol === 'http:' || url.protocol === 'https:'
30}
31
32/**
33 * Load the raw model file from either a URL or a local file

Callers 1

getRawModelFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected