spa

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServer

func FileServer(root http.FileSystem) http.Handler

FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.

As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html".

To use the operating system's file system implementation, use http.Dir:

http.Handle("/", http.FileServer(http.Dir("/tmp")))

To use an fs.FS implementation, use http.FS to convert it:

http.Handle("/", http.FileServer(http.FS(fsys)))

func GetRequestScheme added in v1.4.0

func GetRequestScheme(r *http.Request) string

Types

type HSTSMiddleware added in v1.4.0

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

func NewHSTSMiddleware added in v1.4.0

func NewHSTSMiddleware(next http.Handler, hstsSeconds uint64, includeSubdomains bool, preload bool) (*HSTSMiddleware, error)

func (*HSTSMiddleware) ServeHTTP added in v1.4.0

func (o *HSTSMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OembedMiddleware added in v1.3.0

type OembedMiddleware struct {
	URL *url.URL
	// contains filtered or unexported fields
}

func NewOembedMiddleware added in v1.3.0

func NewOembedMiddleware(next http.Handler, urlStr string) (*OembedMiddleware, error)

func (*OembedMiddleware) ServeHTTP added in v1.3.0

func (o *OembedMiddleware) 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