updated dependencies and go 1.17
This commit is contained in:
parent
58caf0527e
commit
76360ddbc2
32 changed files with 434 additions and 174 deletions
3
vendor/github.com/gorilla/mux/mux.go
generated
vendored
3
vendor/github.com/gorilla/mux/mux.go
generated
vendored
|
|
@ -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
vendor/github.com/gorilla/mux/regexp.go
generated
vendored
6
vendor/github.com/gorilla/mux/regexp.go
generated
vendored
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue