[codex] fix plugin manifest size preflight#2325
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe plugin worker now applies CORS middleware globally to all routes by importing and registering ChangesCORS Middleware Integration
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/plugin-cors.unit.test.ts`:
- Around line 17-18: The test in tests/plugin-cors.unit.test.ts currently
asserts only OPTIONS and content-type on the preflight response; update the
assertions around response.headers.get('access-control-allow-methods') and
response.headers.get('access-control-allow-headers') to also verify that 'POST'
is present in the allowed methods and that 'authorization' (use lowercase or
normalize via .toLowerCase()) is present in the allowed headers so the test
fails if the requested POST method or Authorization header are not whitelisted.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7ea362cd-e663-4115-b5d0-ac43f1a2116b
📒 Files selected for processing (2)
cloudflare_workers/plugin/index.tstests/plugin-cors.unit.test.ts
|



Summary (AI generated)
OPTIONS /updates/manifest_size.Motivation (AI generated)
Browser requests to
https://api.capgo.app/updates/manifest_sizesend a CORS preflight before the POST. The plugin worker did not handle that preflight, so it fell through to the catch-all route and returned404 Not Found.Business Impact (AI generated)
This restores manifest-size requests from browser clients, preventing console/API users from seeing failed preflight requests for that endpoint while keeping the existing plugin POST behavior unchanged.
Test Plan (AI generated)
bun run lint:backendbunx eslint cloudflare_workers/plugin/index.ts tests/plugin-cors.unit.test.tsbunx vitest run tests/plugin-cors.unit.test.ts tests/manifest-size.unit.test.tsbun run cli:build && vue-tsc --noEmitGenerated with AI
Summary by CodeRabbit
New Features
Tests