UNPKG

@uppy/companion

Version:

OAuth helper and remote fetcher for Uppy's (https://uppy.io) extensible file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Dropbox and Google Drive, S3 and more :dog:

36 lines (35 loc) 1.09 kB
/** * Gets the size and content type of a url's content * * @param {string} url * @param {boolean} allowLocalIPs * @returns {Promise<{name: string, type: string, size: number}>} */ export function getURLMeta(url: string, allowLocalIPs?: boolean, options?: any): Promise<{ name: string; type: string; size: number; }>; export const FORBIDDEN_IP_ADDRESS: "Forbidden IP address"; /** * Validates that the download URL is secure * * @param {string} url the url to validate * @param {boolean} allowLocalUrls whether to allow local addresses */ export function validateURL(url: string, allowLocalUrls: boolean): boolean; /** * Returns http Agent that will prevent requests to private IPs (to prevent SSRF) */ export function getProtectedHttpAgent({ protocol, allowLocalIPs }: { protocol: any; allowLocalIPs: any; }): { new (options?: https.AgentOptions): { createConnection(options: any, callback: any): any; }; }; export function getProtectedGot({ allowLocalIPs }: { allowLocalIPs: any; }): import("got").Got; import https from 'node:https';