mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-09 13:04:52 +02:00
Updates all API functions, to work on both Vercel & Netlify
This commit is contained in:
@ -38,7 +38,7 @@ const isPgpSigned = (result) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
const securityTxtHandler = async (urlParam) => {
|
||||
const handler = async (urlParam) => {
|
||||
|
||||
let url;
|
||||
try {
|
||||
@ -69,8 +69,6 @@ const securityTxtHandler = async (urlParam) => {
|
||||
return { isPresent: false };
|
||||
};
|
||||
|
||||
exports.handler = middleware(securityTxtHandler);
|
||||
|
||||
async function fetchSecurityTxt(baseURL, path) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = new URL(path, baseURL);
|
||||
@ -91,3 +89,6 @@ async function fetchSecurityTxt(baseURL, path) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = middleware(handler);
|
||||
module.exports.handler = middleware(handler);
|
||||
|
Reference in New Issue
Block a user