瀏覽代碼

Merge pull request #41401 from thaJeztah/bump_mux

vendor: github.com/gorilla/mux v1.8.0
Brian Goff 4 年之前
父節點
當前提交
ae0ef82b90
共有 3 個文件被更改,包括 8 次插入3 次删除
  1. 1 1
      vendor.conf
  2. 1 2
      vendor/github.com/gorilla/mux/mux.go
  3. 6 0
      vendor/github.com/gorilla/mux/regexp.go

+ 1 - 1
vendor.conf

@@ -4,7 +4,7 @@ github.com/Microsoft/go-winio                       6c72808b55902eae4c5943626030
 github.com/docker/libtrust                          9cbd2a1374f46905c68a4eb3694a130610adc62a
 github.com/golang/gddo                              72a348e765d293ed6d1ded7b699591f14d6cd921
 github.com/google/uuid                              0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1
-github.com/gorilla/mux                              75dcda0896e109a2a22c9315bca3bb21b87b2ba5 # v1.7.4
+github.com/gorilla/mux                              98cb6bf42e086f6af920b965c38cacc07402d51b # v1.8.0
 github.com/Microsoft/opengcs                        a10967154e143a36014584a6f664344e3bb0aa64
 github.com/moby/term                                73f35e472e8f0a3f91347164138ce6bd73b756a9
 

+ 1 - 2
vendor/github.com/gorilla/mux/mux.go

@@ -435,8 +435,7 @@ func Vars(r *http.Request) map[string]string {
 // CurrentRoute returns the matched route for the current request, if any.
 // This only works when called inside the handler of the matched route
 // because the matched route is stored in the request context which is cleared
-// after the handler returns, unless the KeepContext option is set on the
-// Router.
+// after the handler returns.
 func CurrentRoute(r *http.Request) *Route {
 	if rv := r.Context().Value(routeKey); rv != nil {
 		return rv.(*Route)

+ 6 - 0
vendor/github.com/gorilla/mux/regexp.go

@@ -325,6 +325,12 @@ func (v routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {
 	// Store host variables.
 	if v.host != nil {
 		host := getHost(req)
+		if v.host.wildcardHostPort {
+			// Don't be strict on the port match
+			if i := strings.Index(host, ":"); i != -1 {
+				host = host[:i]
+			}
+		}
 		matches := v.host.regexp.FindStringSubmatchIndex(host)
 		if len(matches) > 0 {
 			extractVars(host, matches, v.host.varsN, m.Vars)