middleware

package
v1.9.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UncompressMiddleware = func(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		if r.Header.Get("Content-Encoding") == "gzip" {
			r.Body = &gzipReader{body: r.Body}
		}
		h.ServeHTTP(w, r)
	})
}

UncompressMiddleware uncompresses gzipped HTTP requests carrying a 'Content-Encoding: gzip' header.

Functions

func LimitConcurrentRequests

func LimitConcurrentRequests(maxRequests int) func(http.Handler) http.Handler

this is to make sure that we don't have more than `maxClient` in-memory at any point of time. As, having more http client than `maxClient` may lead to gateway OOM kill.

Types

This section is empty.

Jump to

Keyboard shortcuts

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