httputil

package
v0.0.0-...-0f89dd2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package httputil implements HTTP utility functions for working with HTTP requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBodySizeWithinLimit

func IsBodySizeWithinLimit(header http.Header, limit int64) bool

IsBodySizeWithinLimit checks if the Content-Length of the response is within the specified limit. If the limit is zero or negative, it always returns true.

func MaxAge

func MaxAge(header http.Header) int

MaxAge returns the max-age value in seconds if found in the Cache-Control header. It returns -1 if the header is not present or if the value is not a valid number.

Types

This section is empty.

Jump to

Keyboard shortcuts

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