Pretend to be facebook and twitter bots
This commit is contained in:
parent
86341f063c
commit
c108c20c91
@ -306,8 +306,11 @@ function removePreview(msg, preview) {
|
|||||||
|
|
||||||
function getRequestHeaders(headers) {
|
function getRequestHeaders(headers) {
|
||||||
const formattedHeaders = {
|
const formattedHeaders = {
|
||||||
|
// Certain websites like Amazon only add <meta> tags to known bots,
|
||||||
|
// lets pretend to be them to get the metadata
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge)",
|
"Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge)" +
|
||||||
|
" facebookexternalhit/1.1 Twitterbot/1.0",
|
||||||
Accept: headers.accept || "*/*",
|
Accept: headers.accept || "*/*",
|
||||||
"X-Purpose": "preview",
|
"X-Purpose": "preview",
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user