Skip to content

Commit

Permalink
fix (saml): fix possible panic in WithAdditionalACSEndpoint(...)
Browse files Browse the repository at this point in the history
changed  location url to be passed by value to eliminate possible
panic
  • Loading branch information
jimlambrt committed Sep 9, 2023
1 parent 06396ac commit 65cb44c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions saml/sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func WithACSServiceBinding(b core.ServiceBinding) Option {
}

// WithAdditionalACSEndpoint provides an optional additional ACS endpoint
func WithAdditionalACSEndpoint(b core.ServiceBinding, location url.URL) Option {
return func(o interface{}) {
if o, ok := o.(*metadataOptions); ok {
o.additionalACSs = append(o.additionalACSs, metadata.Endpoint{
Expand Down
2 changes: 1 addition & 1 deletion saml/sp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func Test_CreateMetadata_Options(t *testing.T) {
got := provider.CreateMetadata(
saml.WithAdditionalACSEndpoint(
core.ServiceBindingHTTPRedirect,
redirectEndpoint,
*redirectEndpoint,
),
)

Expand Down

0 comments on commit 65cb44c

Please sign in to comment.