handler

package
v1.1.34 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOptionsHandler

func CreateOptionsHandler(methods ...string) http.HandlerFunc

CreateOptionsHandler creates a generic options handler that takes a list of allowed methods.

func HeadHandler added in v1.1.14

func HeadHandler(next http.Handler) http.HandlerFunc

HeadHandler returns a handler that prevents a body from being returned for any wrapped request handler if the HTTP method is HEAD.

Types

type HeadResponseWriter added in v1.1.14

type HeadResponseWriter struct {
	Bytes      int
	StatusCode int
	// contains filtered or unexported fields
}

HeadResponseWriter captures input to an http.ResponseWriter

func (*HeadResponseWriter) Header added in v1.1.14

func (w *HeadResponseWriter) Header() http.Header

Header proxies http.ResponseWriter Header

func (*HeadResponseWriter) Write added in v1.1.14

func (w *HeadResponseWriter) Write(b []byte) (int, error)

Write prevents http.ResponseWriter Write from writing anything to the response body for HEAD requests.

func (*HeadResponseWriter) WriteHeader added in v1.1.14

func (w *HeadResponseWriter) WriteHeader(statusCode int)

WriteHeader proxies http.ResponseWriter WriteHeader

Jump to

Keyboard shortcuts

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