diff --git a/internal/entrypoint/entrypoint.go b/internal/entrypoint/entrypoint.go index 5cd58468..da7370d6 100644 --- a/internal/entrypoint/entrypoint.go +++ b/internal/entrypoint/entrypoint.go @@ -22,7 +22,7 @@ type Entrypoint struct { notFoundHandler http.Handler accessLogger accesslog.AccessLogger findRouteFunc func(host string) types.HTTPRoute - shortLinkTree *ShortLinkMatcher + shortLinkMatcher *ShortLinkMatcher } // nil-safe @@ -36,12 +36,12 @@ func init() { func NewEntrypoint() Entrypoint { return Entrypoint{ findRouteFunc: findRouteAnyDomain, - shortLinkTree: newShortLinkTree(), + shortLinkMatcher: newShortLinkMatcher(), } } func (ep *Entrypoint) ShortLinkMatcher() *ShortLinkMatcher { - return ep.shortLinkTree + return ep.shortLinkMatcher } func (ep *Entrypoint) SetFindRouteDomains(domains []string) { @@ -130,9 +130,9 @@ func (ep *Entrypoint) tryHandleShortLink(w http.ResponseWriter, r *http.Request) } if strings.EqualFold(host, common.ShortLinkPrefix) { if ep.middleware != nil { - ep.middleware.ServeHTTP(ep.shortLinkTree.ServeHTTP, w, r) + ep.middleware.ServeHTTP(ep.shortLinkMatcher.ServeHTTP, w, r) } else { - ep.shortLinkTree.ServeHTTP(w, r) + ep.shortLinkMatcher.ServeHTTP(w, r) } return true } diff --git a/internal/entrypoint/shortlink.go b/internal/entrypoint/shortlink.go index e3bf20c1..e62dc9ca 100644 --- a/internal/entrypoint/shortlink.go +++ b/internal/entrypoint/shortlink.go @@ -14,7 +14,7 @@ type ShortLinkMatcher struct { subdomainRoutes *xsync.Map[string, struct{}] } -func newShortLinkTree() *ShortLinkMatcher { +func newShortLinkMatcher() *ShortLinkMatcher { return &ShortLinkMatcher{ fqdnRoutes: xsync.NewMap[string, string](), subdomainRoutes: xsync.NewMap[string, struct{}](),