Improve scraping server

This commit is contained in:
Pieter Vander Vennet 2024-04-30 15:59:19 +02:00
parent bf523848fb
commit 5759d4f8a7
2 changed files with 20 additions and 7 deletions

View file

@ -91,6 +91,12 @@ export class Server {
try {
const result = await handler.handle(path, url.searchParams)
if(result === undefined){
res.writeHead(500)
res.write("Could not fetch this website, probably blocked by them")
res.end()
return
}
if (typeof result !== "string") {
console.error(
"Internal server error: handling",