fix(tests): add missing headers to diffs index.test.ts localReq mock#39063
Closed
Shennng wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(tests): add missing headers to diffs index.test.ts localReq mock#39063Shennng wants to merge 1 commit intoopenclaw:mainfrom
Shennng wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Add headers property to localReq() mock helper in extensions/diffs/index.test.ts to match the pattern already used in http.test.ts (commit 44881b0). This fixes the test failure: TypeError: Cannot read properties of undefined (reading 'x-forwarded-for') at hasProxyForwardingHints extensions/diffs/src/http.ts:180:9 at resolveViewerAccess extensions/diffs/src/http.ts:193:58 at extensions/diffs/index.test.ts:124:27 The hasProxyForwardingHints() function tries to access req.headers, but the mock in index.test.ts was missing this property while http.test.ts already had it. Fixes openclaw#39047
Contributor
Greptile SummaryThis PR fixes a Changes:
Impact:
Confidence Score: 5/5
Last reviewed commit: eeaa1d6 |
This was referenced Mar 7, 2026
Contributor
|
Please don't send PRs for CI stuff, it takes far longer to review a PR than to fix while we work. |
steipete
added a commit
that referenced
this pull request
Mar 7, 2026
Co-authored-by: Shennng <[email protected]>
Contributor
|
Superseded and landed directly on What I did:
SHA hashes:
Thanks for surfacing and patching this quickly. |
mrosmarin
added a commit
to mrosmarin/openclaw
that referenced
this pull request
Mar 7, 2026
* main: (133 commits) reduce image size, offer slim image (openclaw#38479) fix(security): harden install base drift cleanup fix(agents): respect explicit provider baseUrl in merge mode (openclaw#39103) fix(agents): apply contextTokens cap for compaction threshold (openclaw#39099) fix(exec): block dangerous override-only env pivots fix(security): stage installs before publish fix(daemon): normalise whitespace in checkTokenDrift to prevent false-positive warning (openclaw#39108) fix(security): harden fs-safe copy writes refactor: dedupe bluebubbles webhook auth test setup refactor: dedupe discord native command test scaffolding refactor: dedupe anthropic probe target test setup refactor: dedupe minimax provider auth test setup refactor: dedupe runtime snapshot test fixtures fix: harden zip extraction writes fix(tests): stabilize diffs localReq headers (supersedes openclaw#39063) fix: harden workspace skill path containment fix(agents): land openclaw#38935 from @MumuTW fix(models): land openclaw#38947 from @davidemanuelDEV fix(gateway): land openclaw#39064 from @Narcooo fix(models-auth): land openclaw#38951 from @MumuTW ...
vincentkoc
pushed a commit
to BryanTegomoh/openclaw-fork
that referenced
this pull request
Mar 8, 2026
Co-authored-by: Shennng <[email protected]>
openperf
pushed a commit
to openperf/moltbot
that referenced
this pull request
Mar 8, 2026
Co-authored-by: Shennng <[email protected]>
mcaxtr
pushed a commit
to mcaxtr/openclaw
that referenced
this pull request
Mar 8, 2026
Co-authored-by: Shennng <[email protected]>
Saitop
pushed a commit
to NomiciAI/openclaw
that referenced
this pull request
Mar 8, 2026
Co-authored-by: Shennng <[email protected]>
GordonSH-oss
pushed a commit
to GordonSH-oss/openclaw
that referenced
this pull request
Mar 9, 2026
Co-authored-by: Shennng <[email protected]>
jenawant
pushed a commit
to jenawant/openclaw
that referenced
this pull request
Mar 10, 2026
Co-authored-by: Shennng <[email protected]>
4 tasks
dhoman
pushed a commit
to dhoman/chrono-claw
that referenced
this pull request
Mar 11, 2026
Co-authored-by: Shennng <[email protected]>
senw-developers
pushed a commit
to senw-developers/va-openclaw
that referenced
this pull request
Mar 17, 2026
Co-authored-by: Shennng <[email protected]>
V-Gutierrez
pushed a commit
to V-Gutierrez/openclaw-vendor
that referenced
this pull request
Mar 17, 2026
Co-authored-by: Shennng <[email protected]>
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.
Summary
extensions/diffs/index.test.tsthrowsTypeError: Cannot read properties of undefined (reading x-forwarded-for)in theapplies plugin-config defaultstest case.checks (node, extensions)CI job due to this.headers: input.headers ?? {}to thelocalReq()mock helper.Changes
extensions/diffs/index.test.tsto addheadersproperty tolocalReq()function, matching the pattern already used inhttp.test.ts(commit 44881b0).Testing
The fix resolves:
Compatibility
Fixes #39047