Repository navigation
deps: express 5.3.0 + path-to-regexp v8 wildcard fix - #75
Merged
Merged
Conversation
Bumps [express](https://github.com/expressjs/express) from 4.22.2 to 5.3.0. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](expressjs/express@v4.22.2...v5.3.0) --- updated-dependencies: - dependency-name: express dependency-version: 5.3.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
… if the server cannot start
# Conflicts: # package-lock.json # package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #73
根因
#73(express 4.22.2 → 5.3.0)的 CI:claims run 39091258609 显示
ERR test-count [error] timed out after 120s (exit 124),test run 39091258611 一直卡在npm test(已手动取消)。原因有两层:server.js的 SPA 兜底路由app.get('*', …)在 Express 5(path-to-regexp v8)下不合法,node server.js直接抛出:PathError [TypeError]: Missing parameter name at index 1: *。所有要起服务的测试都报server exited before ready。test/llm.test.js有两个用例先起 mock OpenAI 服务、再startServer。startServer抛错时走不到try/finally,mock 不会关,开着的监听让node --test永远不退出。修复
server.js:app.get('*', …)改成app.get('/{*splat}', …)。这种具名通配写法和 Express 4 的*一样,也能匹配/。test/llm.test.js:startServer(NO_CLI).catch(async (e) => { await mock.close(); throw e; })。以后服务再起不来,这个文件约 2 秒就失败,不会把 CI 挂住(用改坏的 server.js 验证过:6 fail、exit 1、2s)。package.json/package-lock.json:express ^5.3.0(同 chore: bump express from 4.22.2 to 5.3.0 #73)。:param;req.query只读平铺的键;req.body都有|| {}兜底;没有用res.send(status)、app.del、req.param()。本地验证(Node 22.23.3)
npm ci(完整构建 UI):✓ built in 601ms;pure.js 和 diagnostics.cjs 没有漂移;biome checkexit 0npm test:# tests 348 · # pass 348 · # fail 0 · # cancelled 0,耗时 8 秒(合并 master 的 security: rate-limit every route (express-rate-limit) — fixes CodeQL js/missing-rate-limiting #76 之后是 349/349)16 machine-checked · 16 ok · 0 failed · 0 error · 3 manual/、/some/deep/path、/legacy、/legacy/x/y、/api/version、/api/agents?dir=…、/assets/nope.js→ 200/200/301/200/200/500/200验收标准
# tests 349 # pass 349 # fail 0(合并 security: rate-limit every route (express-rate-limit) — fixes CodeQL js/missing-rate-limiting #76 后多了限流测试)16 machine-checked · 16 ok · 0 failed · 0 error · 3 manual,test-count 是 ok,不再超时更新(合并 master 之后)
已把 master(含 #76 限流)合并进本分支(a286e55,普通 push)。
app.use(limiter)在/{*splat}之前挂载,新增的限流测试也覆盖了 SPA 兜底(/no/such/page)。CodeQL:No new alerts in code changed by this pull request,#78 已是 fixed。