Skip to content

Commit

Permalink
Refactor bestip endpoint in _worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
3Kmfi6HP committed Mar 23, 2024
1 parent 65cf322 commit 54a43d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ export default {
});
};
case `/bestip/${userID_Path}`: {
const bestSubConfig = await fetch(`https://sub.xf.free.hr/auto?host=${request.headers.get('Host')}&uuid=${userID}`);
// Construct and return response object
const userAgent = request.headers.get('User-Agent');
const url = `https://sub.xf.free.hr/auto?host=${request.headers.get('Host')}&uuid=${userID}&path=/`;
const bestSubConfig = await fetch(url, { headers: { 'User-Agent': userAgent } });
return bestSubConfig;
};
default:
Expand Down

0 comments on commit 54a43d7

Please sign in to comment.