fix: add User-Agent header to avoid bot-blocking on security.txt fetch

This commit is contained in:
jorgearma
2026-04-21 00:33:02 +02:00
parent 44b8b44575
commit 795d41ff42

View File

@@ -74,7 +74,7 @@ const securityTxtHandler = async (urlParam) => {
async function fetchSecurityTxt(baseURL, path) {
return new Promise((resolve, reject) => {
const url = new URL(path, baseURL);
https.get(url.toString(), (res) => {
https.get(url.toString(), { headers: { 'User-Agent': 'curl/8.0.0' } }, (res) => {
if (res.statusCode === 200) {
let data = '';
res.on('data', (chunk) => {