We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5578b72 + 795d41f commit 55d8657Copy full SHA for 55d8657
1 file changed
api/security-txt.js
@@ -53,7 +53,7 @@ const securityTxtHandler = async (urlParam) => {
53
for (let path of SECURITY_TXT_PATHS) {
54
try {
55
const result = await fetchSecurityTxt(url, path);
56
- if (result && result.includes('<html')) return { isPresent: false };
+ if (result && result.includes('<html')) continue;
57
if (result) {
58
return {
59
isPresent: true,
@@ -74,7 +74,7 @@ const securityTxtHandler = async (urlParam) => {
74
async function fetchSecurityTxt(baseURL, path) {
75
return new Promise((resolve, reject) => {
76
const url = new URL(path, baseURL);
77
- https.get(url.toString(), (res) => {
+ https.get(url.toString(), { headers: { 'User-Agent': 'curl/8.0.0' } }, (res) => {
78
if (res.statusCode === 200) {
79
let data = '';
80
res.on('data', (chunk) => {
0 commit comments