{{ message }}
Repository navigation
github: avoid unnecessary allocations during request validation. - #343186
Open
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Open
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Conversation
Dirk Bäumer (dbaeumer)
approved these changes
Oct 21, 2026
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
This PR updates GitHub client schema parsing and request handling to reduce allocations and prevent untrusted request options/payload fields from overriding internal controls.
Changes:
- Updated schema parsers to reuse unchanged arrays/objects, and added
parse.copyObjectfor explicit field filtering. - Hardened raw content request handling by whitelisting transport options (preventing overrides of URL/limits/timeouts).
- Adjusted request plumbing to separate request bodies from request metadata (e.g., for IPC/validation).
Review effort: Lite
Comment on lines
+302
to
+311
| /** Copies own fields, including non-enumerable values, into a plain object. */ | ||
| function copyRecord(record: Record<string, unknown>): Record<string, unknown> { | ||
| const result = { ...record }; | ||
| for (const key of Object.getOwnPropertyNames(record)) { | ||
| if (!Object.hasOwn(result, key)) { | ||
| defineEntry(result, key, record[key]); | ||
| } | ||
| } | ||
| return result; | ||
| } |
Comment on lines
+44
to
+47
This branch has not been deployed
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.



No description provided.