MCPcopy
hub / github.com/lissy93/web-check / fetchSecurityTxt

Function fetchSecurityTxt

api/security-txt.js:70–77  ·  view source on GitHub ↗
(baseURL, path)

Source from the content-addressed store, hash-verified

68
69// Returns the file body when the path 200s, else null so the next path is tried
70const 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
79export const handler = middleware(securityTxtHandler);
80export default handler;

Callers 1

securityTxtHandlerFunction · 0.85

Calls 1

httpGetFunction · 0.90

Tested by

no test coverage detected