fix: pathname 有search的时候有问题
This commit is contained in:
parent
42e32adf86
commit
73118f8454
@ -5,7 +5,7 @@
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "cross-env NODE_ENV=development nodemon --exec tsx src/index.ts",
|
||||
"dev": "cross-env NODE_ENV=development nodemon --ignore upload --exec tsx src/index.ts",
|
||||
"build": "rimraf dist && rollup -c",
|
||||
"deploy": "rsync -avz dist/ light:~/apps/var-proxy/backend",
|
||||
"reload": "ssh light pm2 restart proxy",
|
||||
|
@ -112,8 +112,10 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
|
||||
app = data.app;
|
||||
}
|
||||
}
|
||||
const url = req.url;
|
||||
if (!domainApp && noProxyUrl.includes(req.url)) {
|
||||
// const url = req.url;
|
||||
const pathname = new URL(req.url, `http://${dns.hostName}`).pathname;
|
||||
const url = pathname;
|
||||
if (!domainApp && noProxyUrl.includes(url)) {
|
||||
res.write('No proxy for this URL\n');
|
||||
return res.end();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user