mirror of
https://github.com/Lissy93/web-check.git
synced 2026-05-13 06:01:02 -04:00
fix: add User-Agent header to avoid bot-blocking on security.txt fetch
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user