path_rewriter

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 10 Imported by: 0

README

Path Rewriter

Path Rewriter can both re-write paths and result in a client side redirect to a new path based on configuration.

xyzzy - Additional Documentation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbOn map[string]bool = make(map[string]bool)

Functions

func HexEscapeNonASCII

func HexEscapeNonASCII(s string) string

HexEscapeNonASCII - taken directly from the Go source - encodes a string for use in a Location: header.

func LogIntrnalRewrite

func LogIntrnalRewrite(from string, to string)

func NewPathRewriteHandler

func NewPathRewriteHandler(handler http.Handler, cfg *PathRewriteType, b string, dbF map[string]bool, sug *zap.SugaredLogger) http.Handler

Types

type PathFromToType

type PathFromToType struct {
	From     []string
	To       string
	Client   int    // non 0 causes a client side re-direct, 302, 307 for example
	Location string //
}

type PathRewriteType

type PathRewriteType struct {
	PathRewrite []PathFromToType `json:"path_rewrite"`
}

Jump to

Keyboard shortcuts

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