mirror of
https://github.com/gin-gonic/gin.git
synced 2026-07-17 00:41:15 +08:00
Merge 4aa07a2bb2ac8bc06ba0a28f63a983d6a96a8eb0 into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d
This commit is contained in:
commit
3de7edfbd9
3
path.go
3
path.go
@ -5,6 +5,8 @@
|
||||
|
||||
package gin
|
||||
|
||||
const stackBufSize = 128
|
||||
|
||||
// cleanPath is the URL version of path.Clean, it returns a canonical URL path
|
||||
// for p, eliminating . and .. elements.
|
||||
//
|
||||
@ -19,7 +21,6 @@ package gin
|
||||
//
|
||||
// If the result of this process is an empty string, "/" is returned.
|
||||
func cleanPath(p string) string {
|
||||
const stackBufSize = 128
|
||||
// Turn empty string into "/"
|
||||
if p == "" {
|
||||
return "/"
|
||||
|
||||
2
tree.go
2
tree.go
@ -679,8 +679,6 @@ walk: // Outer loop for walking the tree
|
||||
// It returns the case-corrected path and a bool indicating whether the lookup
|
||||
// was successful.
|
||||
func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) ([]byte, bool) {
|
||||
const stackBufSize = 128
|
||||
|
||||
// Use a static sized buffer on the stack in the common case.
|
||||
// If the path is too long, allocate a buffer on the heap instead.
|
||||
buf := make([]byte, 0, stackBufSize)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user