1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-17723] - [Web | Browser | Desktop] Cannot search for port in vault login item URI (#15962)

* add port search in uriExtractor

* revert to original check
This commit is contained in:
Jordan Aasen
2025-08-25 14:07:22 -07:00
committed by GitHub
parent 0fbebdc6c4
commit ae2259db2f

View File

@@ -426,11 +426,30 @@ export class SearchService implements SearchServiceAbstraction {
if (u.uri == null || u.uri === "") {
return;
}
if (u.hostname != null) {
uris.push(u.hostname);
return;
}
// Match ports
const portMatch = u.uri.match(/:(\d+)(?:[/?#]|$)/);
const port = portMatch?.[1];
let uri = u.uri;
if (u.hostname !== null) {
uris.push(u.hostname);
if (port) {
uris.push(`${u.hostname}:${port}`);
uris.push(port);
}
return;
} else {
const slash = uri.indexOf("/");
const hostPart = slash > -1 ? uri.substring(0, slash) : uri;
uris.push(hostPart);
if (port) {
uris.push(`${hostPart}`);
uris.push(port);
}
}
if (u.match !== UriMatchStrategy.RegularExpression) {
const protocolIndex = uri.indexOf("://");
if (protocolIndex > -1) {