mirror of
https://github.com/yusing/godoxy.git
synced 2026-02-18 08:27:43 +01:00
refactor(middleware): clone middleware definitions before modification
- This change enhances the integrity of middleware configurations by ensuring original definitions remain unchanged.
This commit is contained in:
@@ -3,6 +3,7 @@ package middleware
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
@@ -92,6 +93,7 @@ func BuildMiddlewareFromChainRaw(name string, defs []map[string]any) (*Middlewar
|
||||
chainErr.AddSubjectf(err, "%s[%d]", name, i)
|
||||
continue
|
||||
}
|
||||
def = maps.Clone(def)
|
||||
delete(def, "use")
|
||||
m, err := base.New(def)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user