Skip to content

Commit

Permalink
fix(console): fix path regexp cve, close koishijs/koishi#1457
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Sep 17, 2024
1 parent 81e0573 commit 855422a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/console/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class NodeConsole extends Console {
private serveAssets() {
const { uiPath } = this.config

this.ctx.server.get(uiPath + '(/.+)*', async (ctx, next) => {
this.ctx.server.get(uiPath + '(.*)', async (ctx, next) => {
await next()
if (ctx.body || ctx.response.body) return

Expand Down Expand Up @@ -215,7 +215,7 @@ class NodeConsole extends Console {
},
})

this.ctx.server.all('/vite(/.+)*', (ctx) => new Promise((resolve) => {
this.ctx.server.all('/vite(.*)', (ctx) => new Promise((resolve) => {
this.vite.middlewares(ctx.req, ctx.res, resolve)
}))

Expand Down

0 comments on commit 855422a

Please sign in to comment.