fix: long caching flutter_bootstrap.js which stop new UI from showing up#562
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFastAPI web-serving logic for Flutter Web updated: stricter non-caching headers, new ChangesFlutter Web Cache-Busting Strategy
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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
🤖 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 `@app/main.py`:
- Around line 454-465: The code in serve_spa constructs file_path =
WEB_BUILD_PATH / full_path from user input and returns
serve_static_file(FileResponse) without verifying the resolved path stays inside
WEB_BUILD_PATH, allowing directory traversal via “..”. Fix by resolving both
WEB_BUILD_PATH and the joined file path (use Path.resolve()) then verify the
resolved file_path is a child of WEB_BUILD_PATH (e.g.,
resolved_file_path.is_relative_to(resolved_web_build_path) or compare prefixes);
if the check fails or the resolved path is not a file, return a 404/abort rather
than calling serve_static_file. Also ensure you perform the containment check
before any is_file()/serve_static_file calls and reference serve_spa,
WEB_BUILD_PATH, file_path, full_path, and serve_static_file in the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary by CodeRabbit
New Features
Bug Fixes