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)
| 464 | // It returns the case-corrected path and a bool indicating whether the lookup |
| 465 | // was successful. |
| 466 | func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPath []byte, found bool) { |
| 467 | return n.findCaseInsensitivePathRec( |
| 468 | path, |
| 469 | make([]byte, 0, len(path)+1), // preallocate enough memory for new path |
| 470 | [4]byte{}, // empty rune buffer |
| 471 | fixTrailingSlash, |
| 472 | ) |
| 473 | } |
| 474 | |
| 475 | // shift bytes in array by n bytes left |
| 476 | func shiftNRuneBytes(rb [4]byte, n int) [4]byte { |