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
+24-5
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,
@@ -1142,29 +1143,47 @@ export function parseUnsignedInteger(value: unknown): number | null {
1142
1143
}
1143
1144
1144
1145
/**
1145
-
* Determines whether a provided address matches the provided parent domain.
1146
+
* This function throws a MongoAPIError in the event that either of the following is true:
1147
+
* * If the provided address domain does not match the provided parent domain
1148
+
* * 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
1146
1149
*
1147
1150
* If a DNS server were to become compromised SRV records would still need to
1148
1151
* advertise addresses that are under the same domain as the srvHost.
1149
1152
*
1150
1153
* @param address - The address to check against a domain
1151
1154
* @param srvHost - The domain to check the provided address against
1152
-
* @returnsWhether the provided address matches the parent domain
0 commit comments