mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 22:47:38 +08:00
Error responses from scraped pages should not return metadata (#2691)
* Don't return error pages as valid scrapes * Fix linting * whitespace
This commit is contained in:
committed by
Wyatt Johnson
parent
f1a0febd6c
commit
0645735d2b
@@ -75,6 +75,12 @@ const scraper = {
|
||||
});
|
||||
const html = await res.text();
|
||||
|
||||
if (!res.ok) {
|
||||
let err = new Error(res.statusText);
|
||||
err.response = res;
|
||||
throw err;
|
||||
}
|
||||
|
||||
// Get the metadata from the scraped html.
|
||||
const meta = await metascraper({
|
||||
html,
|
||||
|
||||
Reference in New Issue
Block a user