diff -Nru golang-github-gorilla-mux-1.7.4/debian/changelog golang-github-gorilla-mux-1.8.0/debian/changelog --- golang-github-gorilla-mux-1.7.4/debian/changelog 2020-07-11 13:58:58.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/debian/changelog 2021-10-15 10:44:59.000000000 +0000 @@ -1,3 +1,15 @@ +golang-github-gorilla-mux (1.8.0-1) unstable; urgency=medium + + * New upstream version 1.8.0 + * Change Section from devel to golang + * Bump debhelper dependency to "Build-Depends: debhelper-compat (= 13)" + * Bump Standards-Version to 4.6.0 (no change) + * Add "Rules-Requires-Root: no" to debian/control + * Add myself to the list of Uploaders + * debian/gbp.conf: Set debian-branch to debian/sid for DEP-14 conformance + + -- Anthony Fok Fri, 15 Oct 2021 04:44:59 -0600 + golang-github-gorilla-mux (1.7.4-1) unstable; urgency=medium * Team upload. diff -Nru golang-github-gorilla-mux-1.7.4/debian/control golang-github-gorilla-mux-1.8.0/debian/control --- golang-github-gorilla-mux-1.7.4/debian/control 2020-07-11 13:58:58.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/debian/control 2021-10-15 10:44:59.000000000 +0000 @@ -1,18 +1,20 @@ Source: golang-github-gorilla-mux -Section: devel +Section: golang Testsuite: autopkgtest-pkg-go Priority: optional Maintainer: Debian Go Packaging Team Uploaders: Arnaud Rebillout , Tianon Gravi , - Tim Potter + Tim Potter , + Anthony Fok , Build-Depends: - debhelper-compat (= 12), + debhelper-compat (= 13), dh-golang, Build-Depends-Indep: golang-any, -Standards-Version: 4.4.1.1 +Standards-Version: 4.6.0 Homepage: https://github.com/gorilla/mux +Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-gorilla-mux.git Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-gorilla-mux XS-Go-Import-Path: github.com/gorilla/mux @@ -22,6 +24,7 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, +Multi-Arch: foreign Description: powerful URL router and dispatcher for golang Package gorilla/mux implements a request router and dispatcher. . diff -Nru golang-github-gorilla-mux-1.7.4/debian/gbp.conf golang-github-gorilla-mux-1.8.0/debian/gbp.conf --- golang-github-gorilla-mux-1.7.4/debian/gbp.conf 2020-07-11 13:58:58.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/debian/gbp.conf 2021-10-15 10:44:59.000000000 +0000 @@ -1,2 +1,4 @@ [DEFAULT] +debian-branch = debian/sid +dist = DEP14 pristine-tar = True diff -Nru golang-github-gorilla-mux-1.7.4/debian/.gitignore golang-github-gorilla-mux-1.8.0/debian/.gitignore --- golang-github-gorilla-mux-1.7.4/debian/.gitignore 2020-07-11 13:58:58.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/debian/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -*.debhelper.log -*.substvars -golang-github-gorilla-mux-dev/ -files -tmp/ diff -Nru golang-github-gorilla-mux-1.7.4/mux.go golang-github-gorilla-mux-1.8.0/mux.go --- golang-github-gorilla-mux-1.7.4/mux.go 2020-01-12 19:17:43.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/mux.go 2020-07-11 20:05:21.000000000 +0000 @@ -435,8 +435,7 @@ // 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) diff -Nru golang-github-gorilla-mux-1.7.4/old_test.go golang-github-gorilla-mux-1.8.0/old_test.go --- golang-github-gorilla-mux-1.7.4/old_test.go 2020-01-12 19:17:43.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/old_test.go 2020-07-11 20:05:21.000000000 +0000 @@ -261,6 +261,18 @@ result: true, }, { + matcher: NewRouter().NewRoute().Host("{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}:{port:.*}"), + url: "http://abc.def.ghi:65535/", + vars: map[string]string{"foo": "abc", "bar": "def", "baz": "ghi", "port": "65535"}, + result: true, + }, + { + matcher: NewRouter().NewRoute().Host("{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}"), + url: "http://abc.def.ghi:65535/", + vars: map[string]string{"foo": "abc", "bar": "def", "baz": "ghi"}, + result: true, + }, + { matcher: NewRouter().NewRoute().Host("{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}"), url: "http://a.b.c/", vars: map[string]string{"foo": "abc", "bar": "def", "baz": "ghi"}, @@ -366,6 +378,11 @@ url: "http://bar.domain.com", }, { + route: new(Route).Host("{subdomain}.domain.com:{port:.*}"), + vars: []string{"subdomain", "bar", "port", "65535"}, + url: "http://bar.domain.com:65535", + }, + { route: new(Route).Host("foo.domain.com").Path("/articles"), vars: []string{}, url: "http://foo.domain.com/articles", @@ -412,7 +429,11 @@ func TestHostMatcher(t *testing.T) { for _, v := range hostMatcherTests { - request, _ := http.NewRequest("GET", v.url, nil) + request, err := http.NewRequest("GET", v.url, nil) + if err != nil { + t.Errorf("http.NewRequest failed %#v", err) + continue + } var routeMatch RouteMatch result := v.matcher.Match(request, &routeMatch) vars := routeMatch.Vars diff -Nru golang-github-gorilla-mux-1.7.4/regexp.go golang-github-gorilla-mux-1.8.0/regexp.go --- golang-github-gorilla-mux-1.7.4/regexp.go 2020-01-12 19:17:43.000000000 +0000 +++ golang-github-gorilla-mux-1.8.0/regexp.go 2020-07-11 20:05:21.000000000 +0000 @@ -325,6 +325,12 @@ // 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)