Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#7491 from ipfs/fix/ipns-resolve-leak
Browse files Browse the repository at this point in the history
fix 3 bugs responsible for a goroutine leak (plus one other bug)

This commit was moved from ipfs/kubo@538174f
  • Loading branch information
Stebalien authored Jun 19, 2020
2 parents 43e80e3 + 67db99d commit ff0c91e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/core/corehttp/hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func HostnameOption() ServeOption {
// Not a whitelisted path

// Try DNSLink, if it was not explicitly disabled for the hostname
if !gw.NoDNSLink && isDNSLinkRequest(n.Context(), coreApi, r) {
if !gw.NoDNSLink && isDNSLinkRequest(r.Context(), coreApi, r) {
// rewrite path and handle as DNSLink
r.URL.Path = "/ipns/" + stripPort(r.Host) + r.URL.Path
childMux.ServeHTTP(w, r)
Expand Down Expand Up @@ -176,7 +176,7 @@ func HostnameOption() ServeOption {
// 1. is wildcard DNSLink enabled (Gateway.NoDNSLink=false)?
// 2. does Host header include a fully qualified domain name (FQDN)?
// 3. does DNSLink record exist in DNS?
if !cfg.Gateway.NoDNSLink && isDNSLinkRequest(n.Context(), coreApi, r) {
if !cfg.Gateway.NoDNSLink && isDNSLinkRequest(r.Context(), coreApi, r) {
// rewrite path and handle as DNSLink
r.URL.Path = "/ipns/" + stripPort(r.Host) + r.URL.Path
childMux.ServeHTTP(w, r)
Expand Down

0 comments on commit ff0c91e

Please sign in to comment.