chore(release): 0.15.1 - #34
Merged
Merged
Conversation
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.
Defect
createRequestLogreadreq.pathinside theres'finish'listener. By then, for a request that ended inside a mounted router (e.g. a guard 401 on a router mounted at/api/admin), Express has rewrittenreq.path/req.baseUrlto be router-relative - so the log line carriedpath: "/whoami"instead of"/api/admin/whoami", and therouteFromUrlfallback normalized the same truncated value. Found during today's estate rollout.Requests that match a handler were unaffected.
Fix
Capture the identity once at middleware entry:
originalUrladded as an optional field on the structurally-typedRequestLogRequest(no express dependency).pathfield and as therouteFromUrlfallback input.baseUrl + route.path, evaluated at finish as before.Tests
Three new cases in
test/request-log.test.ts:finish, log still carries/api/admin/whoamifor bothpathandroute.originalUrl.originalUrlpreferred over the rewrittenpathfor the RegExp-route fallback.226 tests green (
npm run verify), existing cases unchanged.Release
PR title is
chore(release): 0.15.1so the squash commit trips the publish gate in.github/workflows/release.yml- merging publishes 0.15.1 to npm. Lockfile diff is version fields only.