(baseURL, path)
| 68 | |
| 69 | // Returns the file body when the path 200s, else null so the next path is tried |
| 70 | const fetchSecurityTxt = async (baseURL, path) => { |
| 71 | const url = new URL(path, baseURL); |
| 72 | const res = await httpGet(url.toString(), { |
| 73 | headers: { 'User-Agent': 'curl/8.0.0' }, |
| 74 | validateStatus: () => true, |
| 75 | }); |
| 76 | return res.status === 200 ? res.data : null; |
| 77 | }; |
| 78 | |
| 79 | export const handler = middleware(securityTxtHandler); |
| 80 | export default handler; |
no test coverage detected