MCPcopy Create free account
hub / github.com/devfeel/dotweb / findCaseInsensitivePath

Method findCaseInsensitivePath

tree.go:592–600  ·  view source on GitHub ↗

Makes a case-insensitive lookup of the given path and tries to find a handler. It can optionally also fix trailing slashes. It returns the case-corrected path and a bool indicating whether the lookup was successful.

(path string, fixTrailingSlash bool)

Source from the content-addressed store, hash-verified

590// It returns the case-corrected path and a bool indicating whether the lookup
591// was successful.
592func (n *Node) findCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPath []byte, found bool) {
593 return n.findCaseInsensitivePathRec(
594 path,
595 strings.ToLower(path),
596 make([]byte, 0, len(path)+1), // preallocate enough memory for new path
597 [4]byte{}, // empty rune buffer
598 fixTrailingSlash,
599 )
600}
601
602// shift bytes in array by n bytes left
603func shiftNRuneBytes(rb [4]byte, n int) [4]byte {

Callers 1

ServeHTTPMethod · 0.80

Calls 1

Tested by

no test coverage detected