( url: string | undefined, errorMessage: string, )
| 13 | ) => Promise<Response> |
| 14 | |
| 15 | function errorResult( |
| 16 | url: string | undefined, |
| 17 | errorMessage: string, |
| 18 | ): ReadUrlOutput { |
| 19 | return [{ type: 'json', value: { ...(url ? { url } : {}), errorMessage } }] |
| 20 | } |
| 21 | |
| 22 | function isAllowedUrl(url: URL): boolean { |
| 23 | return url.protocol === 'http:' || url.protocol === 'https:' |