Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle URL paths better (cross-seed#514)
added a `basePath` argument to `extractCredentialsFromURL` that should hopefully prevent us from making the same mistake I made again. ```js > extractCredentialsFromUrl('http://admin:adminadmin@localhost:8080/qbit') OkResult { contents: { username: 'admin', password: 'adminadmin', href: 'http://localhost:8080/qbit' } } > extractCredentialsFromUrl('http://admin:adminadmin@localhost:8080') OkResult { contents: { username: 'admin', password: 'adminadmin', href: 'http://localhost:8080' } } > extractCredentialsFromUrl('http://admin:adminadmin@localhost:8080/qbit', '/api/v2') OkResult { contents: { username: 'admin', password: 'adminadmin', href: 'http://localhost:8080/qbit/api/v2' } } > extractCredentialsFromUrl('http://admin:adminadmin@localhost:8080', '/api/v2') OkResult { contents: { username: 'admin', password: 'adminadmin', href: 'http://localhost:8080/api/v2' } } ``` --------- Co-authored-by: zakary <[email protected]>
- Loading branch information