Skip to content

Commit adbb741

Browse files
Fix TryGetLocationForGatewayDiagnostics returning true for unknown endpoints
The fallthrough path returned 'true' unconditionally after calling GetLocation, even when GetLocation returned null for unrecognized endpoints. Changed to 'return regionName != null' to match the contract and the default-endpoint branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b2ea3f0 commit adbb741

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public bool TryGetLocationForGatewayDiagnostics(Uri endpoint, out string regionN
209209
}
210210

211211
regionName = this.GetLocation(endpoint);
212-
return true;
212+
return regionName != null;
213213
}
214214

215215
/// <summary>

0 commit comments

Comments
 (0)