mirror of
https://github.com/Lissy93/web-check.git
synced 2025-02-16 18:30:48 +01:00
Merge pull request #121 from KostLinux/FIX/json-doctype
Fix bug with JSON Doctype
This commit is contained in:
commit
c9631e6848
@ -25,7 +25,11 @@ const handler = async (domain) => {
|
||||
});
|
||||
|
||||
res.on('end', () => {
|
||||
resolve(JSON.parse(data));
|
||||
try {
|
||||
resolve(JSON.parse(data));
|
||||
} catch (error) {
|
||||
reject(new Error('Invalid JSON response'));
|
||||
}
|
||||
});
|
||||
|
||||
res.on('error', error => {
|
||||
@ -50,5 +54,4 @@ const handler = async (domain) => {
|
||||
};
|
||||
|
||||
module.exports = middleware(handler);
|
||||
module.exports.handler = middleware(handler);
|
||||
|
||||
module.exports.handler = middleware(handler);
|
Loading…
Reference in New Issue
Block a user