fix(gw): remove hardcoded hostnames
This closes #7317 by removing hardcoded PL hostnames from default config, making the localhost the only implicit gateway hostname.
Marcin Rataj committed
Apr 12, 2021 at 18:03 UTC
9f8964e6f9fe881014d0dd20b9f1a069971c1874
1 file changed
+2
-10
core/corehttp/hostname.go
+2
-10
@@ -23,12 +23,7 @@ import (
23
nsopts "github.com/ipfs/interface-go-ipfs-core/options/namesys"
24
)
25
26
-var defaultPaths = []string{"/ipfs/", "/ipns/", "/api/", "/p2p/", "/version"}
27
-
28
-var pathGatewaySpec = &config.GatewaySpec{
29
- Paths: defaultPaths,
30
- UseSubdomains: false,
31
-}
26
+var defaultPaths = []string{"/ipfs/", "/ipns/", "/api/", "/p2p/"}
27
28
var subdomainGatewaySpec = &config.GatewaySpec{
29
Paths: defaultPaths,
@@ -36,10 +31,7 @@ var subdomainGatewaySpec = &config.GatewaySpec{
31
}
32
33
var defaultKnownGateways = map[string]*config.GatewaySpec{
39
- "localhost": subdomainGatewaySpec,
40
- "ipfs.io": pathGatewaySpec,
41
- "gateway.ipfs.io": pathGatewaySpec,
42
- "dweb.link": subdomainGatewaySpec,
34
+ "localhost": subdomainGatewaySpec,
35
}
36
37
// Label's max length in DNS (https://tools.ietf.org/html/rfc1034#page-7)