Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan committed Jan 23, 2024
1 parent 2a82cc1 commit dd5e6fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flyteadmin/auth/handler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ func isAuthorizedRedirectURL(url *url.URL, authorizedURL *url.URL) bool {
return url.Hostname() == authorizedURL.Hostname() && url.Port() == authorizedURL.Port() && url.Scheme == authorizedURL.Scheme
}

func GetRedirectURLAllowed(ctx context.Context, redirectParam string, cfg *config.Config) bool {
if len(redirectParam) == 0 {
func GetRedirectURLAllowed(ctx context.Context, urlRedirectParam string, cfg *config.Config) bool {
if len(urlRedirectParam) == 0 {
logger.Debugf(ctx, "not validating whether empty redirect url is authorized")
return true
}
redirectURL, err := url.Parse(redirectParam)
redirectURL, err := url.Parse(urlRedirectParam)
if err != nil {
logger.Debugf(ctx, "failed to parse user-supplied redirect url: %s with err: %v", redirectParam, err)
logger.Debugf(ctx, "failed to parse user-supplied redirect url: %s with err: %v", urlRedirectParam, err)
return false
}

Check warning on line 164 in flyteadmin/auth/handler_utils.go

View check run for this annotation

Codecov / codecov/patch

flyteadmin/auth/handler_utils.go#L162-L164

Added lines #L162 - L164 were not covered by tests
if redirectURL.Host == "" {
Expand Down

0 comments on commit dd5e6fa

Please sign in to comment.