stripprefix

package
v0.0.0-...-891d2fd Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause, BSD-3-Clause Imports: 3 Imported by: 0

README

#stripprefix

GoDoc

This package defines a request handler that simply attempts to mutatet the request object by stripping a given prefix from it.

##Dependencies

These are the only two external dependencies required as they are necessary to take into account the execution context of a request-handling goroutine.

##License

BSD 3-clause

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler returns a xhttp.Handler which sole purpose is to remove a given prefix from the http request URL path. If the prefix does not exist, a 404 HTTP error is sent.

func NewHandler

func NewHandler(prefix string) Handler

NewHandler returns a request Handler whose task is simply to mutate the request object by stripping it from a given prefix.

Link registers a next request Handler to be called by ServeHTTP method. It returns the result of the linking.

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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