mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-24 07:56:24 +08:00
17 lines
372 B
Go
17 lines
372 B
Go
package headers
|
|
|
|
import "github.com/mholt/caddy/middleware"
|
|
|
|
// New constructs and configures a new headers middleware instance.
|
|
func New(c middleware.Controller) (middleware.Middleware, error) {
|
|
|
|
rules, err := parse(c)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return func(next middleware.Handler) middleware.Handler {
|
|
return Headers{Next: next, Rules: rules}
|
|
}, nil
|
|
}
|