From 62b8664cd8b117d6b30df7bcae9119f67c8e0636 Mon Sep 17 00:00:00 2001 From: 3Kmfi6HP <58669916+3Kmfi6HP@users.noreply.github.com> Date: Sat, 20 Jan 2024 23:32:19 +0700 Subject: [PATCH] Update _worker.js --- _worker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_worker.js b/_worker.js index 2530c97..9c1584a 100644 --- a/_worker.js +++ b/_worker.js @@ -60,11 +60,11 @@ export default { const searchParams = url.searchParams; let vlessConfig = createVLESSSub(userID, request.headers.get('Host')); // If 'format' query param equals to 'clash', convert config to base64 - if (searchParams.get('format') === 'clash') { - vlessConfig = btoa(vlessConfig); + if (searchParams.get('format') === 'text') { + vlessConfig = vlessConfig; } // Construct and return response object - return new Response(vlessConfig, { + return new Response(btoa(vlessConfig), { status: 200, headers: { "Content-Type": "text/plain;charset=utf-8", @@ -725,7 +725,7 @@ function getVLESSConfig(userIDs, hostName) { // Prepare output array let output = []; let header = []; - const sublink = `https://${hostName}/sub/${userIDArray[0]}?format=clash` + const sublink = `https://${hostName}/sub/${userIDArray[0]}` const clash_link = `https://subconverter.do.xn--b6gac.eu.org/sub?target=clash&url=${encodeURIComponent(sublink)}&insert=false&emoji=true&list=false&tfo=false&scv=true&fdn=false&sort=false&new_name=true`; header.push(`\n

图片描述`); header.push(`\nWelcome! This function generates configuration for VLESS protocol. If you found this useful, please check our GitHub project for more:\n`);