From ae2259db2f221ecccee30fb7441fc62545d1ed91 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:07:22 -0700 Subject: [PATCH] [PM-17723] - [Web | Browser | Desktop] Cannot search for port in vault login item URI (#15962) * add port search in uriExtractor * revert to original check --- .../src/vault/services/search.service.ts | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/libs/common/src/vault/services/search.service.ts b/libs/common/src/vault/services/search.service.ts index cb6ac4a0ed..041f978f4e 100644 --- a/libs/common/src/vault/services/search.service.ts +++ b/libs/common/src/vault/services/search.service.ts @@ -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) {