Skip to content

Commit

Permalink
fix: normalize catch-all listeners to loopback (#2287)
Browse files Browse the repository at this point in the history
Closes #1821

Co-authored-by: Russell Dempsey <[email protected]>
  • Loading branch information
lidel and SgtPooki authored Nov 7, 2024
1 parent 437b8fe commit edf14c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bundles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ function getURLFromAddress (name, config) {
if (!config) return null

try {
const address = Array.isArray(config.Addresses[name])
const address = (Array.isArray(config.Addresses[name])
? config.Addresses[name][0]
: config.Addresses[name]
: config.Addresses[name])
.replace(/\/0\.0\.0\.0\//, '/127.0.0.1/') // fix for https://github.com/ipfs/ipfs-webui/issues/1821
.replace(/\/::\//, '/::1/')
const url = toUri(address, { assumeHttp: true })
if (new URL(url).port === 0) throw Error('port set to 0, not deterministic')
return url
Expand Down

0 comments on commit edf14c6

Please sign in to comment.