Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not prepend with authentication information portion of a URL #4

Open
Arttse opened this issue May 10, 2016 · 5 comments
Open

Not prepend with authentication information portion of a URL #4

Arttse opened this issue May 10, 2016 · 5 comments

Comments

@Arttse
Copy link

Arttse commented May 10, 2016

Ok, in 1.0.4 you added support to ignore protocols with non colon-slash-slash. But now it not prepend with auth (the authentication information portion of a URL). Example:

const prependHttp = require('prepend-http');

prependHttp('login:[email protected]');
//=> login:[email protected]

prependHttp('login:[email protected]:1234');
//=> login:[email protected]:1234

prependHttp('login:[email protected]/path/name');
//=> login:[email protected]/path/name

In version 1.0.3 it worked correctly.

@sindresorhus
Copy link
Owner

sindresorhus commented May 10, 2016

Basic Auth in the URL is deprecated and strongly recommended against. It was even removed from Chrome. You should rather use a header, or even better, something other than Basic Auth.

http://serverfault.com/a/541206/11987

I would go with a mention in the docs, but if you really need it, I would be open to a good PR with tests.

@Arttse
Copy link
Author

Arttse commented May 10, 2016

It Is not recommended, but still used. This can be useful for someone when working with URLs.

@kevva
Copy link
Contributor

kevva commented Sep 5, 2016

How would you differentiate mailto:[email protected] from login:[email protected]? Otherwise, this would work /^\.*\/|^(?!localhost)(?!\S+(:\S*)?@)\w+:/.test(url).

@Daniel15
Copy link

Daniel15 commented Jul 9, 2017

Basic Auth in the URL is deprecated and strongly recommended against.

Digest auth is not deprecated, and can use the same login:[email protected] URL format.

@sindresorhus
Copy link
Owner

The only way to support this is to let the user decide between only supporting http/https and have auth support or not auth support and have support for the mailto scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants