gzhandler

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gzhandler provides an HTTP file server implementation that serves pre-compressed files when available to clients that support gzip encoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(root fs.FS) http.Handler

New creates a handler that serves HTTP requests with the contents of the file system rooted at root and uses pre-compressed .gz files when available, with appropriate headers.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is an http.Handler that checks for pre-compressed files and serves them with appropriate headers when available.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves a file with special handling for pre-compressed .gz files

Jump to

Keyboard shortcuts

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