From c35fcf8d6c69a9091ee6bd75153fa82188077e91 Mon Sep 17 00:00:00 2001 From: qq_41923622 Date: Sat, 22 Feb 2025 18:24:00 +0800 Subject: [PATCH] Sat Feb 22 18:24:00 CST 2025 inscode --- index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 45c89c6..9dd8203 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,7 @@ const server = http.createServer(async(req, res) => { proxyDataObj.info.is_pay='1' console.log(proxyDataObj) res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' }); - res.end(`${proxyDataObj}`); + res.end(`${JSON.stringify(proxyDataObj)}`); }else{ proxy.options.target=subdirectoryMappings.h5hunlihu; req.headers['origin'] = subdirectoryMappings.shunlihu; @@ -151,7 +151,7 @@ const server = http.createServer(async(req, res) => { } - if(new RegExp(`^\/map\/`).test(req.url)){ + if(new RegExp(`^\/map`).test(req.url)){ // proxyRes.headers = res.setHeader('Access-Control-Allow-Origin', '*'); // 允许所有请求方法 @@ -170,9 +170,6 @@ res.setHeader('Access-Control-Allow-Credentials', 'true'); // 将请求代理到目标服务器 proxy.web(req, res); } - - -} }); // 监听端口 const port = 9080; -- GitLab