mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
Move the kataras/go-serializer into one iris' file.
Start organising the kataras/go-*package which are relative to the Iris project. The kataras/go-*package will be exists and their features will be adapted to Iris every 2 months, as we say at readme, iris-relative packages should be tested for a long time before adapted to Iris. With this way we have stability, code readability(the developer can easly navigate to iris' code without need to move across different kataras/ projects). Former-commit-id: db291faaf59d4f53f14ce5800fde805f56c8b802
This commit is contained in:
@@ -522,14 +522,17 @@ func New() iris.Policies {
|
||||
RouterReversionPolicy: iris.RouterReversionPolicy{
|
||||
// path normalization done on iris' side
|
||||
StaticPath: func(path string) string {
|
||||
|
||||
i := strings.IndexByte(path, parameterStartByte)
|
||||
x := strings.IndexByte(path, matchEverythingByte)
|
||||
if i > -1 {
|
||||
return path[0:i]
|
||||
}
|
||||
if x > -1 {
|
||||
return path[0:x]
|
||||
v := strings.IndexByte(path, matchEverythingByte)
|
||||
if i > -1 || v > -1 {
|
||||
if i < v {
|
||||
return path[0:i]
|
||||
}
|
||||
// we can't return path[0:0]
|
||||
if v > 0 {
|
||||
return path[0:v]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user