fix: url.format() should support options parameter - #27885
Conversation
Fixes oven-sh#24233 Node.js url.format() accepts an options object with properties: - fragment: boolean - whether to include the fragment (default: true) - unicode: boolean - whether to convert Unicode hostnames - search: boolean - whether to include the search/query - auth: boolean - whether to include auth Bun's implementation ignored the options parameter completely. Now url.format(url, { fragment: false }) correctly strips the fragment. Before: url.format(new URL('https://example.org?abc#foo'), { fragment: false }) // 'https://example.org/?abc#foo' (fragment still included) After: url.format(new URL('https://example.org?abc#foo'), { fragment: false }) // 'https://example.org/?abc' (fragment correctly removed)
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
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. This behavior landed on main separately in #34660, which makes Verified on a build of current main (165dc9f): This PR is no longer needed, so closing it. |
Fixes #24233
Node.js
url.format()accepts an options object to control URL formatting, but Bun's implementation ignored this parameter.Problem
Solution
Modified
Url.prototype.format()to accept and respect theoptionsparameter:fragment: false- removes the fragment (#foo)Changes
src/js/node/url.tsfragmentoption to control hash inclusionurl.format()behaviorTest Case