From 022f8b53eec6bfc6baff36ce0b83c9ff6fde5815 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Mon, 18 Nov 2024 16:52:21 +0700 Subject: [PATCH] fix url absolute check, ensure task setup only modifies docker-desktop (#1239) --- Taskfile.yml | 2 +- backend/LexBoxApi/Services/EmailService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 933eeff18..0306ea674 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -38,7 +38,7 @@ tasks: - git submodule update --recursive - git config --local submodule.recurse true - kubectl --context=docker-desktop apply -f deployment/setup/namespace.yaml - - kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml + - kubectl --context=docker-desktop apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml - docker build -t local-dev-init data/ setup-win: platforms: [ windows ] diff --git a/backend/LexBoxApi/Services/EmailService.cs b/backend/LexBoxApi/Services/EmailService.cs index d73353b11..0e5669066 100644 --- a/backend/LexBoxApi/Services/EmailService.cs +++ b/backend/LexBoxApi/Services/EmailService.cs @@ -293,7 +293,7 @@ private string MakeLoginRedirectUrl(string jwt, string? returnTo) { ArgumentException.ThrowIfNullOrEmpty(jwt); ArgumentException.ThrowIfNullOrEmpty(returnTo); - if (new Uri(returnTo).IsAbsoluteUri) throw new ArgumentException($"returnTo must be relative, was: {returnTo}", nameof(returnTo)); + if (new Uri(returnTo, UriKind.RelativeOrAbsolute).IsAbsoluteUri) throw new ArgumentException($"returnTo must be relative, was: {returnTo}", nameof(returnTo)); var httpContext = httpContextAccessor.HttpContext; ArgumentNullException.ThrowIfNull(httpContext); var loginRedirect = _linkGenerator.GetUriByAction(httpContext,