summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/middleware/middleware.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-21 00:48:10 +0100
committerWim <wim@42.be>2018-02-21 00:48:10 +0100
commit55ab0c12f12e2f0ee15dccd519e1fca4d011b73b (patch)
tree8d114d1129424e446a0124b9520d2ff3b2175369 /vendor/github.com/labstack/echo/middleware/middleware.go
parentd1227b5fc9de9f7a04fbf71292dd224aa8806411 (diff)
downloadmatterbridge-msglm-55ab0c12f12e2f0ee15dccd519e1fca4d011b73b.tar.gz
matterbridge-msglm-55ab0c12f12e2f0ee15dccd519e1fca4d011b73b.tar.bz2
matterbridge-msglm-55ab0c12f12e2f0ee15dccd519e1fca4d011b73b.zip
Update vendor labstack/echo
Diffstat (limited to 'vendor/github.com/labstack/echo/middleware/middleware.go')
-rw-r--r--vendor/github.com/labstack/echo/middleware/middleware.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/vendor/github.com/labstack/echo/middleware/middleware.go b/vendor/github.com/labstack/echo/middleware/middleware.go
index efcbab91..71f95db7 100644
--- a/vendor/github.com/labstack/echo/middleware/middleware.go
+++ b/vendor/github.com/labstack/echo/middleware/middleware.go
@@ -1,6 +1,12 @@
package middleware
-import "github.com/labstack/echo"
+import (
+ "regexp"
+ "strconv"
+ "strings"
+
+ "github.com/labstack/echo"
+)
type (
// Skipper defines a function to skip middleware. Returning true skips processing
@@ -8,6 +14,21 @@ type (
Skipper func(c echo.Context) bool
)
+func captureTokens(pattern *regexp.Regexp, input string) *strings.Replacer {
+ groups := pattern.FindAllStringSubmatch(input, -1)
+ if groups == nil {
+ return nil
+ }
+ values := groups[0][1:]
+ replace := make([]string, 2*len(values))
+ for i, v := range values {
+ j := 2 * i
+ replace[j] = "$" + strconv.Itoa(i+1)
+ replace[j+1] = v
+ }
+ return strings.NewReplacer(replace...)
+}
+
// DefaultSkipper returns false which processes the middleware.
func DefaultSkipper(echo.Context) bool {
return false