You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils.ts
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import type { FindCursor } from './cursor/find_cursor';
18
18
importtype{Db}from'./db';
19
19
import{
20
20
typeAnyError,
21
+
MongoAPIError,
21
22
MongoCompatibilityError,
22
23
MongoInvalidArgumentError,
23
24
MongoNetworkTimeoutError,
@@ -1131,16 +1132,18 @@ export function parseUnsignedInteger(value: unknown): number | null {
1131
1132
}
1132
1133
1133
1134
/**
1134
-
* Determines whether a provided address matches the provided parent domain.
1135
+
* This function throws a MongoAPIError in the event that either of the following is true:
1136
+
* * If the provided address domain does not match the provided parent domain
1137
+
* * If the parent domain contains less than three `.` separated parts and the provided address does not contain at least one more domain level than its parent
1135
1138
*
1136
1139
* If a DNS server were to become compromised SRV records would still need to
1137
1140
* advertise addresses that are under the same domain as the srvHost.
1138
1141
*
1139
1142
* @param address - The address to check against a domain
1140
1143
* @param srvHost - The domain to check the provided address against
1141
-
* @returnsWhether the provided address matches the parent domain
0 commit comments