File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package middleware
33import (
44 "log/slog"
55 "net/http"
6+ "slices"
67
78 "github.com/bsv-blockchain/go-bsv-middleware/pkg/internal/authentication"
89 "github.com/bsv-blockchain/go-sdk/auth"
@@ -97,7 +98,7 @@ func (f *AuthMiddlewareFactory) HTTPHandler(next http.Handler) http.Handler {
9798// This method can be useful when we have factory with default configuration for middleware,
9899// but we want to customize it for a specific handler (for example, turn on unauthenticated access).
99100func (f * AuthMiddlewareFactory ) HTTPHandlerWithOptions (next http.Handler , opts ... func (* AuthMiddlewareConfig )) http.Handler {
100- opts = append (f .options [:] , opts ... )
101+ opts = append (slices . Clone ( f .options ) , opts ... )
101102
102103 if f .wallet == nil {
103104 // In case if someone would create a factory just by calling &middleware.AuthMiddlewareFactory{}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package middleware
33import (
44 "log/slog"
55 "net/http"
6+ "slices"
67
78 "github.com/bsv-blockchain/go-bsv-middleware/pkg/internal/payment"
89 "github.com/bsv-blockchain/go-sdk/wallet"
@@ -66,7 +67,7 @@ func (f *PaymentMiddlewareFactory) HTTPHandler(next http.Handler) http.Handler {
6667// This method can be useful when we have factory with default configuration for middleware,
6768// but we want to customize it for a specific handler (for example use different payment calculator).
6869func (f * PaymentMiddlewareFactory ) HTTPHandlerWithOptions (next http.Handler , opts ... func (* PaymentMiddlewareConfig )) http.Handler {
69- opts = append (f .options [:] , opts ... )
70+ opts = append (slices . Clone ( f .options ) , opts ... )
7071
7172 if f .wallet == nil {
7273 // In case if someone would create a factory just by calling &middleware.PaymentMiddlewareFactory{}
You can’t perform that action at this time.
0 commit comments