Skip to content

Commit

Permalink
Document how protocol-less URLs with basic auth are handled
Browse files Browse the repository at this point in the history
Fixes #184
  • Loading branch information
sindresorhus committed Jul 16, 2023
1 parent 3c7235e commit 2d0bafe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Expand Up @@ -285,6 +285,8 @@ export type Options = {
URLs with custom protocols are not normalized and just passed through by default. Supported protocols are: `https`, `http`, `file`, and `data`.
Human-friendly URLs with basic auth (for example, `user:password@sindresorhus.com`) are not handled because basic auth conflicts with custom protocols. [Basic auth URLs are also deprecated.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#access_using_credentials_in_the_url)
@param url - URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
@example
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Expand Up @@ -32,6 +32,8 @@ normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');

URLs with custom protocols are not normalized and just passed through by default. Supported protocols are: `https`, `http`, `file`, and `data`.

Human-friendly URLs with basic auth (for example, `user:password@sindresorhus.com`) are not handled because basic auth conflicts with custom protocols. [Basic auth URLs are also deprecated.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#access_using_credentials_in_the_url)

#### url

Type: `string`
Expand Down

0 comments on commit 2d0bafe

Please sign in to comment.