basically add declutter like capabilities.

This commit is contained in:
Jason Schwarzenberger
2020-11-11 17:16:04 +13:00
parent 3169af3002
commit 164b7e72c4
16 changed files with 694 additions and 50 deletions
+18
View File
@@ -0,0 +1,18 @@
const { googleBot } = require('./constants');
const { matchUrlDomain, useGoogleBotSites } = require("./sites");
module.exports.getUserAgent = (url) => {
const useGoogleBot = useGoogleBotSites.some(function (item) {
return typeof item === "string" && matchUrlDomain(item, url);
});
if (!useGoogleBot) {
return {};
}
return {
userAgent: googleBot.userAgent,
headers: {
"X-Forwarded-For": googleBot.ip
}
}
};