Documentation
¶
Overview ¶
Package htmllimits holds the size limits applied when rendering HTML, such as maximum image and stylesheet sizes. Limits guard against inputs large enough to exhaust memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrImageTooLarge = errors.New("html: image exceeds configured limits") ErrDOMTooDeep = errors.New("html: DOM exceeds configured depth limit") ErrDOMTooLarge = errors.New("html: DOM exceeds configured node limit") ErrSVGTooLarge = errors.New("html: SVG raster dimensions exceed configured pixel limit") ErrStyleRulesTooLarge = errors.New("html: stylesheet exceeds configured rule limit") )
Errors reported when HTML input goes past one of the configured limits.
Functions ¶
func Int64Exceeded ¶
Int64Exceeded reports whether value is over limit. A limit of zero or less is treated as no limit.
func IntExceeded ¶
IntExceeded reports whether value is over limit. A limit of zero or less is treated as no limit.
Types ¶
type Limits ¶
type Limits struct {
MaxImagePixels int64
MaxImageBytes int64
MaxDOMDepth int
MaxDOMNodes int
MaxSVGPixels int64
MaxStyleRules int
}
Limits caps how much work one HTML document may cost. A zero field means "use the default"; a negative field turns that limit off.