You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(proxy): keep upload guidance on mixed inspection failures - #2253
When request inspection hits a DLP limit and a separate scanner error on a request with an unreadable upload, the proxy reports the scan error and gives guidance for both the DLP limit and the upload.
Summary by CodeRabbit
Bug Fixes
Improved error details for multipart uploads that cannot be fully scanned, while preserving the inspection-limit hint in the response.
Confirmed that uploads with mixed content that cannot be fully inspected are refused and are not forwarded upstream.
No actionable comments were generated in the recent review.
Walkthrough
The inspection-limit detail now includes scan-error text when a scan error occurs. A multipart upload test checks the refusal response and preserved inspection hint across the forward, intercept, and reverse surfaces.
Changes: Request body reporting
Layer / File(s)
Summary
Combined inspection-limit reporting and upload coverage internal/proxy/bodyscan.go, internal/proxy/decode_inspection_limit_test.go
The detail builder appends scan-error text after the inspection-limit detail and returns false when a scan error is present. The multipart test checks for a 403 response, blockreason.ParseError, no upstream delivery, scan-failure details, and a preserved X-Pipelock-Hint across three proxy surfaces.
This change keeps upload guidance in the proxy's response when a request hits both a DLP inspection limit and a scanner error. The change is small and has test coverage across the proxy surfaces. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(proxy): keep upload guidance on mixed inspection failures" matches the change. The summary shows bodyInspectionLimitDetail in internal/proxy/bodyscan.go now keeps the inspection-limit…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(proxy): keep upload guidance on mixed inspection failures" matches the change. The summary shows bodyInspectionLimitDetail in internal/proxy/bodyscan.go now keeps the inspection-limit detail when a scan error also occurs, appending the scan error text instead of returning early. A new test, TestRequestBodyMixedInspectionKeepsUploadHint, checks that X-Pipelock-Hint keeps both the inspection-limit message and the could-not-be-fully-read message. The PR objectives describe the same goal: reporting the scan error while keeping guidance for both the DLP limit and the upload. The title is specific and concise, and it follows the conventional commit style.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 8b58b17 and abee145.
Files selected for processing: 2
internal/proxy/bodyscan.go
internal/proxy/decode_inspection_limit_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
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
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.
What changed
When request inspection hits a DLP limit and a separate scanner error on a request with an unreadable upload, the proxy reports the scan error and gives guidance for both the DLP limit and the upload.
Summary by CodeRabbit