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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start 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