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
Rezku Point of Sale Icon
Rezku Point of Sale

Designed for Real-World Restaurant Operations

Rezku is an all-inclusive ordering platform and management solution for all types of restaurant and bar concepts. You can now get a fully custom branded downloadable smartphone ordering app for your restaurant exclusively from Rezku.
Learn More
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