Skip to content

Commit

Permalink
fix: add missing ctx argument to IsRedirectURISecureStrict (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar authored Feb 13, 2024
1 parent 505fb24 commit f383529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion authorize_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func IsRedirectURISecure(ctx context.Context, redirectURI *url.URL) bool {
// IsRedirectURISecureStrict is stricter than IsRedirectURISecure and it does not allow custom-scheme
// URLs because they can be hijacked for native apps. Use claimed HTTPS redirects instead.
// See discussion in https://github.com/ory/fosite/pull/489.
func IsRedirectURISecureStrict(redirectURI *url.URL) bool {
func IsRedirectURISecureStrict(ctx context.Context, redirectURI *url.URL) bool {
return redirectURI.Scheme == "https" || (redirectURI.Scheme == "http" && IsLocalhost(redirectURI))
}

Expand Down
2 changes: 1 addition & 1 deletion authorize_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func TestIsRedirectURISecureStrict(t *testing.T) {
} {
uu, err := url.Parse(c.u)
require.NoError(t, err)
assert.Equal(t, !c.err, fosite.IsRedirectURISecureStrict(uu), "case %d", d)
assert.Equal(t, !c.err, fosite.IsRedirectURISecureStrict(context.Background(), uu), "case %d", d)
}
}

Expand Down

0 comments on commit f383529

Please sign in to comment.