Skip to content

url.format removes username and password by default #24343

Description

@davidebombelli

What version of Bun is running?

1.3.1+89fa0f343

What platform is your computer?

Linux 6.8.0-86-generic x86_64 x86_64

What steps can reproduce the bug?

  1. Create a file test.mjs with the following content:
import url from 'node:url';
const myURL = new URL('https://a:b@example.org/');

console.log(url.format(myURL));
  1. Run the file like bun test.mjs

What is the expected behavior?

https://a:b@example.org/ is the output of Node.js

What do you see instead?

https://example.org/ is Bun output

Additional information

Hello,

From #24233 it seems like the options parameter is simply disregarded in url.format. However, even when no options parameter is specified, the default behaviour of url.format is different than how it is supposed to be. In fact, username:password is simply stripped out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmed bugWe can reproduce this issuenice-reproAn unusually helpful reproduction is providednode:url

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions