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.
Click to show internal directories.
Click to hide internal directories.