(url)
| 44 | }; |
| 45 | |
| 46 | const phishTank = async (url) => { |
| 47 | try { |
| 48 | const encoded = Buffer.from(url).toString('base64'); |
| 49 | const res = await httpPost(`https://checkurl.phishtank.com/checkurl/?url=${encoded}`, null, { |
| 50 | headers: { 'User-Agent': 'phishtank/web-check' }, |
| 51 | timeout: 3000, |
| 52 | }); |
| 53 | const parsed = await xml2js.parseStringPromise(res.data, { explicitArray: false }); |
| 54 | return parsed.response.results; |
| 55 | } catch (error) { |
| 56 | return upstreamError(error, 'PhishTank'); |
| 57 | } |
| 58 | }; |
| 59 | |
| 60 | const cloudmersive = async (url) => { |
| 61 | const auth = requireEnv('CLOUDMERSIVE_API_KEY', 'Cloudmersive'); |
no test coverage detected