restrictprefix

package module
v0.0.0-...-8607fc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

README

caddy-restrict-prefix

A middleware to restrict access by a prefix for the caddy webserver

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestrictPrefix

type RestrictPrefix struct {
	Prefix string `json:"prefix,omitempty"`
	// contains filtered or unexported fields
}

RestrictPrefix is middleware that restricts requests where any portion of the URI matches a given prefix.

func (RestrictPrefix) CaddyModule

func (RestrictPrefix) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*RestrictPrefix) Provision

func (p *RestrictPrefix) Provision(ctx caddy.Context) error

Provision a Zap logger to RestrictPrefix.

func (RestrictPrefix) ServeHTTP

ServeHTTP implements the caddyhttp.MiddlewareHandler interface.

func (*RestrictPrefix) Validate

func (p *RestrictPrefix) Validate() error

Validate the prefix from the module's configuration, setting the default prefix "." if necessary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL