diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index 6c0ad5bca13..0a6ec55f2e0 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -221,7 +221,8 @@ func HostnameOption() ServeOption { if !cfg.Gateway.NoDNSLink && isDNSLinkName(r.Context(), coreAPI, host) { // rewrite path and handle as DNSLink r.URL.Path = "/ipns/" + stripPort(host) + r.URL.Path - childMux.ServeHTTP(w, withHostnameContext(r, host)) + ctx := context.WithValue(r.Context(), "dnslink-hostname", host) + childMux.ServeHTTP(w, withHostnameContext(r.WithContext(ctx), host)) return }