Skip to content

Commit e028b3c

Browse files
committed
update for CredentialModel having a Uri type
1 parent 7f6d7d4 commit e028b3c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

App/Services/UriHandler.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ private void CheckAuthority(Uri uri, string errTitle)
140140
$"Failed to open '{uri.AbsolutePath}' because you are not signed in.");
141141
}
142142

143-
// here we assume that the URL is valid since the credentials are marked valid. If not it's an internal error
143+
// here we assume that the URL is non-null since the credentials are marked valid. If not it's an internal error
144144
// and the App will handle catching the exception and logging it.
145-
var coderUri = new Uri(credentialModel.CoderUrl!);
145+
var coderUri = credentialModel.CoderUrl!;
146146
if (uri.Authority != coderUri.Authority)
147147
{
148148
logger.LogWarning(

Tests.App/Services/UriHandlerTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void AgentWorkspaceAndCredentialFixtures()
6464
credentialModel1 = new CredentialModel
6565
{
6666
State = CredentialState.Valid,
67-
CoderUrl = "https://coder.test",
67+
CoderUrl = new Uri("https://coder.test"),
6868
};
6969
}
7070

0 commit comments

Comments
 (0)