Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughBun.file() now rejects HTTP and HTTPS URL strings in both Rust and Zig code paths, returning an InvalidArguments error advising use of fetch(); a unit test verifies both protocols are rejected. ChangesHTTP/HTTPS URL Rejection Feature
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
Thanks for the PR, and sorry it sat for so long. Closing this one: #9506 was closed as fixed on main, which took a different route than this PR. On main, Rejecting http(s) strings at construction time, as this PR does, would be a new behavior change rather than a fix for that issue, so it would need its own issue and discussion; feel free to open one if you still think it is worth doing. The branch also touches src/runtime/webcore/Blob.zig, which was removed in #32621, so it could not land as is either way. |
What does this PR do?
Fixes #9506.
Bun.file()now rejectshttp://andhttps://path strings immediately with a clearer error that tells users to usefetch()instead. The same guard is mirrored in the Rust and ZigBlobimplementations, and the existings3://path remains routed through the S3 file handling branch.How did you verify your code works?
http://andhttps://URL strings.Bun.file("https://...")returned aFileRefinstead of throwing.git diff --check -- src/runtime/webcore/Blob.rs src/runtime/webcore/Blob.zig test/js/bun/util/bun-file.test.ts.BUN_CODEGEN_DIR=C:\bun\build\debug\codegen cargo check -p bun_runtime.I also attempted
bun run build:debugon Windows. The build was blocked before producing a patched Bun binary by a vendor extraction issue inzstd:tar.execould not create Unix-style helper entries undervendor/zstd/tests/cli-tests/bin(Invalid argument).