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
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
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