Skip to content

Commit 7313320

Browse files
Specify UriKind.Absolute
Be explicit and require the URI to be absolute.
1 parent 38e66e2 commit 7313320

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
5656
var challengeUrl = base.BuildChallengeUrl(properties, redirectUri);
5757

5858
// The redirect_uri parameter is not allowed by Automatic and MUST NOT be sent.
59-
var challengeUri = new Uri(challengeUrl);
59+
var challengeUri = new Uri(challengeUrl, UriKind.Absolute);
6060
var query = QueryHelpers.ParseQuery(challengeUri.Query);
6161

6262
query.Remove("redirect_uri");

src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
9292
var challengeUrl = base.BuildChallengeUrl(properties, redirectUri);
9393

9494
// Visual Studio Online/Azure DevOps uses "Assertion" instead of "code"
95-
var challengeUri = new Uri(challengeUrl);
95+
var challengeUri = new Uri(challengeUrl, UriKind.Absolute);
9696
var query = QueryHelpers.ParseQuery(challengeUri.Query);
9797

9898
query["response_type"] = "Assertion";

0 commit comments

Comments
 (0)