htmlrewrite

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceBodyContents

func ReplaceBodyContents(res *http.Response, repl func(match []byte) []byte) error

ReplaceHeadContents allows to replace the contents of the <body> tag in an HTTP response. The repl function is called with the contents of the <body> tag and should return the new contents.

On error, the response body is unchanged and the caller may proceed as if the function had not been called.

func ReplaceHeadContents

func ReplaceHeadContents(res *http.Response, repl func(match []byte) []byte) error

ReplaceHeadContents allows to replace the contents of the <head> tag in an HTTP response. The repl function is called with the contents of the <head> tag and should return the new contents.

On error, the response body is unchanged and the caller may proceed as if the function had not been called.

Types

This section is empty.

Jump to

Keyboard shortcuts

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