Skip to content

Commit 57d9f7e

Browse files
committed
Be explicit about the URI kind when creating URIs
1 parent e069966 commit 57d9f7e

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

backend/src/Configuration/GraphQlConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public MyUuidType(
227227
: base(name, description, defaultFormat, enforceFormat,
228228
bind)
229229
{
230-
SpecifiedBy = new Uri(_specifiedBy);
230+
SpecifiedBy = new Uri(_specifiedBy, UriKind.Absolute);
231231
}
232232
}
233233

@@ -241,7 +241,7 @@ public MyUrlType(
241241
BindingBehavior bind = BindingBehavior.Explicit)
242242
: base(name, description, bind)
243243
{
244-
SpecifiedBy = new Uri(_specifiedBy);
244+
SpecifiedBy = new Uri(_specifiedBy, UriKind.Absolute);
245245
}
246246
}
247247
}

backend/src/Data/DbSeeder.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ await manager.CreateAsync(
186186
{
187187
new Uri(environment.IsEnvironment("test")
188188
? "urn:test"
189-
: $"{host}/connect/callback/login/metabase")
189+
: $"{host}/connect/callback/login/metabase",
190+
UriKind.Absolute)
190191
},
191192
PostLogoutRedirectUris =
192193
{
193194
new Uri(environment.IsEnvironment("test")
194195
? "urn:test"
195-
: $"{host}/connect/callback/logout/metabase")
196+
: $"{host}/connect/callback/logout/metabase",
197+
UriKind.Absolute)
196198
},
197199
Permissions =
198200
{
@@ -250,11 +252,11 @@ await manager.CreateAsync(
250252
},
251253
RedirectUris =
252254
{
253-
new Uri($"{host}/connect/callback/login/metabase")
255+
new Uri($"{host}/connect/callback/login/metabase", UriKind.Absolute)
254256
},
255257
PostLogoutRedirectUris =
256258
{
257-
new Uri($"{host}/connect/callback/logout/metabase")
259+
new Uri($"{host}/connect/callback/logout/metabase", UriKind.Absolute)
258260
},
259261
Permissions =
260262
{

backend/test/Integration/GraphQl/Institutions/InstitutionIntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public abstract class InstitutionIntegrationTests
1717
"Institution A",
1818
"I!A",
1919
"Best institution ever!",
20-
new Uri("https://institution-a.com"),
20+
new Uri("https://institution-a.com", UriKind.Absolute),
2121
null,
2222
Array.Empty<Guid>(),
2323
null

backend/test/Integration/IntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected static HttpClient CreateHttpClient(
9797
new WebApplicationFactoryClientOptions
9898
{
9999
AllowAutoRedirect = allowAutoRedirect,
100-
BaseAddress = new Uri("http://localhost"),
100+
BaseAddress = new Uri("http://localhost", UriKind.Absolute),
101101
HandleCookies = true,
102102
MaxAutomaticRedirections = 3
103103
}

0 commit comments

Comments
 (0)