Skip to content
Myr

path: sync code with httprouter (#2212)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andy Pan · committed by Bo-Yi Wu · parent 424e968 · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:path.go+1 added-2 removed
3 unmodified lines
4// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE.56package gin78const stackBufSize = 12898// cleanPath is the URL version of path.Clean, it returns a canonical URL path9// for p, eliminating . and .. elements.10//11// The following rules are applied iteratively until no further processing can
6 unmodified lines
18// that is, replace "/.." by "/" at the beginning of a path.19//20// If the result of this process is an empty string, "/" is returned.21func cleanPath(p string) string {22 const stackBufSize = 12823 // Turn empty string into "/"24 if p == "" {25 return "/"26 }
113 unmodified lines