mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
15 lines
286 B
Go
15 lines
286 B
Go
|
package middlewares
|
||
|
|
||
|
import (
|
||
|
"github.com/valyala/fasthttp"
|
||
|
)
|
||
|
|
||
|
// Wrap a handler with another middleware if it isn't nil.
|
||
|
func Wrap(middleware Basic, next fasthttp.RequestHandler) (handler fasthttp.RequestHandler) {
|
||
|
if middleware == nil {
|
||
|
return next
|
||
|
}
|
||
|
|
||
|
return middleware(next)
|
||
|
}
|