mud

package
v0.0.0-...-2262381 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileServer

type FileServer struct {
	// The path to the root directory with MUD files.
	// Default is `{http.vars.root}` if set; current working directory otherwise.
	Root string `json:"root,omitempty"`
	// Validate request headers according to https://www.rfc-editor.org/rfc/rfc8520
	// Default is true
	ValidateHeaders *bool `json:"validate_headers,omitempty"`
	// Validate the requested MUD file (if it exists)
	// Default is true
	ValidateMUD *bool `json:"validate_mud,omitempty"`
	// Set ETag header in responses
	// Default is true
	SetETag *bool `json:"set_etag,omitempty"`
	// Set the Server header to `MUD File Server`
	// Default is true; if set to false, this will default to `Caddy`, unless overruled by the Caddy header module
	SetMUDFileServerHeader *bool `json:"set_mud_file_server_header,omitempty"`
}

FileServer implements a MUD File Server responder for Caddy.

func (FileServer) CaddyModule

func (FileServer) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*FileServer) Provision

func (m *FileServer) Provision(ctx caddy.Context) error

Provision sets up the MUD File Server responder.

func (*FileServer) ServeHTTP

func (m *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP is the core handler for the MUD File Server.

Jump to

Keyboard shortcuts

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