Skip to content

Commit

Permalink
Set dnslink-hostname in context
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Johnson committed Apr 12, 2022
1 parent 0479fd1 commit 04de5d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/corehttp/hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 04de5d9

Please sign in to comment.