unpack

package module
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 5 Imported by: 0

README

unpack

Go HTTP middleware which unpacks gzip or deflate-encoded HTTP requests from clients

GoDoc Widget Travis Widget

Example usage (go-chi)

r := chi.NewRouter()
r.Use(unpack.Middleware)
r.Post("/v1/status", someStatusHandler)
http.ListenAndServe("127.0.0.1:8080", r))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware which handles unpacking of requests. It supports unpacking Content-Encoding: gzip and Content-Encoding: deflate. Other encodings are ignored and passed on to the next handler. If the client specifies a supported Content-Encoding but this function fails to parse the body as such, it will fail the request with HTTP 415 and a text/plain error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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