A collection of useful middleware for Go HTTP services & web applications. Package handlers is a collection of handlers (aka "HTTP middleware") for use with Go's net/http package (or any framework supporting http.Handler). LoggingHandler for logging HTTP requests in the Apache Common Log Format. CombinedLoggingHandler for logging HTTP requests in the Apache Combined Log Format commonly used by both Apache and nginx. Compress Chandler for gzipping responses. ContentTypeHandler for validating requests against a list of accepted content types. MethodHandler for matching HTTP methods against handlers in a map[string]http.Handler. ProxyHeaders for populating r.RemoteAddr and r.URL.Scheme based on the X-Forwarded-For, X-Real-IP, X-Forwarded-Proto and RFC7239 Forwarded headers when running a Go server behind a HTTP reverse proxy. CanonicalHost for re-directing to the preferred host when handling multiple domains (i.e. multiple CNAME aliases).

Features

  • CompressHandler for gzipping responses
  • RecoveryHandler for recovering from unexpected panics
  • LoggingHandler for logging HTTP requests in the Apache Common Log Format
  • Package handlers is a collection of handlers
  • LoggingHandler for logging HTTP requests in the Apache Common Log Format
  • CombinedLoggingHandler for logging HTTP requests in the Apache Combined Log Format commonly used by both Apache and nginx

Project Samples

Project Activity

See All Activity >

License

BSD License

Follow gorilla/handlers

gorilla/handlers Web Site

Other Useful Business Software
Stop Storing Third-Party Tokens in Your Database Icon
Stop Storing Third-Party Tokens in Your Database

Auth0 Token Vault handles secure token storage, exchange, and refresh for external providers so you don't have to build it yourself.

Rolling your own OAuth token storage can be a security liability. Token Vault securely stores access and refresh tokens from federated providers and handles exchange and renewal automatically. Connected accounts, refresh exchange, and privileged worker flows included.
Try Auth0 for Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gorilla/handlers!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Registered

2023-01-30