Skip to content

Commit 795d41f

Browse files
committed
fix: add User-Agent header to avoid bot-blocking on security.txt fetch
1 parent 44b8b44 commit 795d41f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

api/security-txt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const securityTxtHandler = async (urlParam) => {
7474
async function fetchSecurityTxt(baseURL, path) {
7575
return new Promise((resolve, reject) => {
7676
const url = new URL(path, baseURL);
77-
https.get(url.toString(), (res) => {
77+
https.get(url.toString(), { headers: { 'User-Agent': 'curl/8.0.0' } }, (res) => {
7878
if (res.statusCode === 200) {
7979
let data = '';
8080
res.on('data', (chunk) => {

0 commit comments

Comments
 (0)