minfix
This commit is contained in:
parent
1afe04e13f
commit
da38582add
|
@ -81,7 +81,7 @@ func (tr *MiddlewareRegistry) Add(pluginName string) error {
|
|||
}
|
||||
|
||||
/* (6) Cast Inspect */
|
||||
inspectCast, ok := inspect.(func(http.Request, Scope))
|
||||
inspectCast, ok := inspect.(func(http.Request, *Scope))
|
||||
if !ok {
|
||||
return fmt.Errorf("Inspect() is malformed")
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ func (mr MiddlewareRegistry) Run(req http.Request) Scope {
|
|||
|
||||
/* (2) Execute each middleware */
|
||||
for _, m := range mr.Middlewares {
|
||||
m.Inspect(req, scope)
|
||||
m.Inspect(req, &scope)
|
||||
}
|
||||
|
||||
return scope
|
||||
|
|
|
@ -11,12 +11,12 @@ type Scope []string
|
|||
|
||||
// Inspector updates the @Scope passed to it according to
|
||||
// the @http.Request
|
||||
type Inspector func(http.Request, Scope)
|
||||
type Inspector func(http.Request, *Scope)
|
||||
|
||||
// Middleware contains all necessary methods
|
||||
// for a Middleware provided by user/developer
|
||||
type MiddleWare struct {
|
||||
Inspect func(http.Request, Scope)
|
||||
Inspect func(http.Request, *Scope)
|
||||
}
|
||||
|
||||
// MiddlewareRegistry represents a registry containing all registered
|
||||
|
|
Loading…
Reference in New Issue