Skip to content

Commit 948db0c

Browse files
committed
Brackets
1 parent 3a2a443 commit 948db0c

File tree

1 file changed

+2
-2
lines changed
  • packages/node/src/integrations/tracing/firebase/otel/patches

1 file changed

+2
-2
lines changed

packages/node/src/integrations/tracing/firebase/otel/patches/firestore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ function setPortAndAddress(span: Span, settings: FirestoreSettings): void {
267267
// IPv6 addresses can be enclosed in square brackets, e.g., [2001:db8::1]:8080
268268
if (settings.host.endsWith(']')) {
269269
// IPv6 with square brackets without port
270-
address = settings.host.slice(1, -1);
270+
address = settings.host.replace(/^\[|\]$/g, '');
271271
} else {
272272
// IPv6 with square brackets with port
273273
const lastColonIndex = settings.host.lastIndexOf(':');
274274
if (lastColonIndex !== -1) {
275-
address = settings.host.slice(1, lastColonIndex);
275+
address = settings.host.slice(1, lastColonIndex).replace(/^\[|\]$/g, '');
276276
port = settings.host.slice(lastColonIndex + 1);
277277
}
278278
}

0 commit comments

Comments
 (0)