fix(proxy): restrict proxy to exact /api routes only (#3456)

This commit is contained in:
khakanali 2024-11-08 04:04:54 +05:00 committed by GitHub
parent cfe2061322
commit 8466e1a0b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ export default defineConfig(async ({ mode }) => {
const serverPort = parseInt(serverEnv?.['PORT'] ?? 3000)
if (!Number.isNaN(serverPort) && serverPort > 0 && serverPort < 65535) {
proxy = {
'/api': {
'^/api(/|$).*': {
target: `http://${serverHost}:${serverPort}`,
changeOrigin: true
},