httputil

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCORS

func SetCORS(w http.ResponseWriter, o *regexp.Regexp, r *http.Request)

SetCORS enables cross-site scripts calls.

Types

type CompressionHandler

type CompressionHandler struct {
	Handler http.Handler
}

CompressionHandler is a wrapper around http.Handler which adds suitable response compression based on the client's Accept-Encoding headers.

func (CompressionHandler) ServeHTTP

func (c CompressionHandler) ServeHTTP(writer http.ResponseWriter, req *http.Request)

ServeHTTP adds compression to the original http.Handler's ServeHTTP() method.

Jump to

Keyboard shortcuts

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