fix: pathname 有search的时候有问题
This commit is contained in:
		| @@ -5,7 +5,7 @@ | |||||||
|   "main": "index.js", |   "main": "index.js", | ||||||
|   "type": "module", |   "type": "module", | ||||||
|   "scripts": { |   "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", |     "build": "rimraf dist && rollup -c", | ||||||
|     "deploy": "rsync -avz dist/ light:~/apps/var-proxy/backend", |     "deploy": "rsync -avz dist/ light:~/apps/var-proxy/backend", | ||||||
|     "reload": "ssh light pm2 restart proxy", |     "reload": "ssh light pm2 restart proxy", | ||||||
|   | |||||||
| @@ -112,8 +112,10 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR | |||||||
|       app = data.app; |       app = data.app; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   const url = req.url; |   // const url = req.url; | ||||||
|   if (!domainApp && noProxyUrl.includes(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'); |     res.write('No proxy for this URL\n'); | ||||||
|     return res.end(); |     return res.end(); | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user