mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-18 10:56:38 +02:00
Skip check if robots.txt not present
This commit is contained in:
parent
519d2f0f79
commit
dbcbd36874
@ -48,7 +48,11 @@ const handler = async function(url) {
|
|||||||
const response = await axios.get(robotsURL);
|
const response = await axios.get(robotsURL);
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
return parseRobotsTxt(response.data);
|
const parsedData = parseRobotsTxt(response.data);
|
||||||
|
if (!parsedData.robots || parsedData.robots.length === 0) {
|
||||||
|
return { skipped: 'No robots.txt file present, unable to continue' };
|
||||||
|
}
|
||||||
|
return parsedData;
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
statusCode: response.status,
|
statusCode: response.status,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user