Skip to content

Commit

Permalink
fix(webui): fix path regexp cve, close cordiverse/cordis#15
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Sep 17, 2024
1 parent 695885c commit 24dd1e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/webui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cordisjs/plugin-webui",
"description": "Web User Interface for Koishi",
"version": "0.1.11",
"version": "0.1.13",
"type": "module",
"exports": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions plugins/webui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class NodeWebUI extends WebUI<NodeWebUI.Config> {
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 @@ -244,7 +244,7 @@ class NodeWebUI extends WebUI<NodeWebUI.Config> {
}],
})

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 24dd1e6

Please sign in to comment.