util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushingIoCopy

func FlushingIoCopy(dst io.Writer, src io.Reader, buf []byte) (written int64, err error)

FlushingIoCopy is analogous to buffering io.Copy(), but also attempts to flush on each iteration. If dst does not implement http.Flusher(e.g. net.TCPConn), it will do a simple io.CopyBuffer(). Reasoning: http2ResponseWriter will not flush on its own, so we have to do it manually.

func RemoveHopByHop

func RemoveHopByHop(header http.Header)

func StripPort

func StripPort(address string) string

borrowed from `proxy` plugin

func WriteSiteNotFound

func WriteSiteNotFound(w http.ResponseWriter, r *http.Request)

WriteSiteNotFound writes appropriate error code to w, signaling that requested host is not served by Caddy on a given port.

func WriteTextResponse

func WriteTextResponse(w http.ResponseWriter, status int, body string)

WriteTextResponse writes body with code status to w. The body will be interpreted as plain text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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