Cover is_image_media_type_token non-image prefix arm - #238
Open
seonghobae wants to merge 1 commit into
Open
Conversation
|
Warning Review limit reachedNext included review available in 30 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
Call is_image_media_type_token directly with non-image types so the
strip_prefix("image/") None arm executes. Public data: URI scanning
searches data:image/ and cannot reach that return false.
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/image-unit-media-type-coverage-aa68
branch
from
August 25, 2026 10:19
1521f1d to
7266ec9
Compare
seonghobae
marked this pull request as ready for review
August 25, 2026 10:21
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.
Why
Protected-main product coverage is still missing one authored line and one False branch in
evidence_core::image_unit:is_image_media_type_tokenreturn falseafterstrip_prefix("image/")let Some(subtype) = … elseFalse armThe public scanner searches
data:image/, so that None arm is unreachable throughcontains_base64_image_data_uri. This PR covers the helper directly. No production behavior change.What changed
Direct unit test
non_image_media_type_token_refuses_non_image_prefixcalls the private helper withtext/plain,application/json, andtext/plain;charset=utf-8. CHANGELOG no longer claims public non-image data URIs cover that line.Overlap
#241 closes the same gap by rewriting the helper to
unwrap_or_default()(plus network_analysis coverage). If #241 lands first, this PR should rebase or close rather than re-introduce the let-else. Prefer this PR when the contract should keep an explicit non-image prefix refusal instead of collapsing it into the empty-subtype path.#240 must not merge:
0ce16e88already restored pre-#232 psychometric sources.Local verification on
7266ec93(rebased ontoc482ccea)text/plainfailed.cargo test -p evidence_core --all-features --lib non_image_media_type_token_refuses_non_image_prefixpassed.cargo test -p evidence_core --all-featurespassed.cargo fmt --all --checkclean.cargo clippy -p evidence_core --all-features -- -D warningsclean.image_unit.rsDA:152,3;check_coverage.py312/312.image_unit.rs30/30; unique fold[151, 9, 151, 22]false=3; 96/96.python3 scripts/validate_documentation.pypassed.python3 scripts/check_docstrings.pypassed.Workspace llvm-cov remains the exact-head CI gate. Strix is not product CI. Not full #167 closure.