built-in mime type exclusion list - #98
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe extension adds built-in MIME-type exclusions, checks them with configured exclusions before compression, reports them in module information, packages the new header, and updates documentation and output-buffer tests. ChangesMIME exclusion handling
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant OutputHandler
participant BuiltinExclusions
participant ConfiguredExclusions
OutputHandler->>BuiltinExclusions: Match response MIME type
OutputHandler->>ConfiguredExclusions: Match response MIME type
OutputHandler->>OutputHandler: Reject compression when either list matches
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/ob_exclude_002.phpt (1)
17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd or confirm independent coverage for built-in exclusions.
This test uses
brotli.output_compression_exclude_types=image/*, so it exercises the configured wildcard list. Becauseimage/svgis not inBROTLI_MIMETYPE_EXCLUDE, the test would still pass if the built-in exclusion check were removed. Add or confirm a case with an empty configured list and a built-in type such asimage/pngorapplication/pdf.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ob_exclude_002.phpt` at line 17, Add an independent test case for built-in MIME-type exclusions, using an empty brotli.output_compression_exclude_types configuration and a built-in excluded type such as image/png or application/pdf. Keep the existing wildcard-list coverage in tests/ob_exclude_002.phpt, and ensure the new case verifies exclusion without relying on the configured list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@brotli.c`:
- Line 23: Add php_brotli_mimetype_exclude.h to package.xml as a source file
using the same package file-list section that contains php_brotli.h. Ensure the
header is included in PECL release contents so the include in brotli.c resolves
without a missing-file error.
---
Nitpick comments:
In `@tests/ob_exclude_002.phpt`:
- Line 17: Add an independent test case for built-in MIME-type exclusions, using
an empty brotli.output_compression_exclude_types configuration and a built-in
excluded type such as image/png or application/pdf. Keep the existing
wildcard-list coverage in tests/ob_exclude_002.phpt, and ensure the new case
verifies exclusion without relying on the configured list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 520d4725-ce56-4a4f-9b2b-16ba6716756f
📒 Files selected for processing (5)
README.mdbrotli.cphp_brotli_mimetype_exclude.htests/ob_exclude_001.phpttests/ob_exclude_002.phpt
💤 Files with no reviewable changes (1)
- tests/ob_exclude_001.phpt
f6b8829 to
2b76cba
Compare
2b76cba to
416ee17
Compare
|
brotli version of phpinfo improvements coming at some point during coming days |
same thing as kjdev/php-ext-zstd#104
Summary by CodeRabbit