go-ipfs v0.5.1
https://github.com/ipfs/go-ipfs/blob/master/core/corehttp/hostname.go#L37-L42
It seems ok to me to implicitly accept localhost when no public gateway is defined but including the Protocol Labs gateway as well seems too much. At least when explicitly defined, those should not be included as well.
Isn't this the same as https://github.com/ipfs/go-ipfs/issues/7281?
It's related but not the same.
This issue is about the config not being honored as it should (extra gateways are added without the possibility to avoid it).
Ah, got it.
So, in this case, you _can_ disable these gateways, but you need to explicitly map "domain": null (documented in docs/config.md but a bit hard to find...). The idea is that this lets us extend/change this list in the future if necessary, even when the user wants to add _additional_ gateways.
A better solution may be to add a DefaultPublicGateways: bool flag. Thoughts @MichaelMure & @lidel?
AFAIK those implicit entries were included so canonical gateways work in HTTP Proxy mode:
$ chromium --user-data-dir=$(mktemp -d) --proxy-server="http://127.0.0.1:8080" "http://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
..but I don't think many people will use it due to HSTS limitations, nor care if we remove them and ask for manual add if someone wants to use HTTP proxy.
If anything, just remove them, adding additional flag would be an overkill.
you need to explicitly map "domain": null (documented in docs/config.md but a bit hard to find...)
Hooo, I see. Well you still need to know that they are there in the first place (that is, read the code) ;)
What about simply doing something like:
```diff
diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go
index 143435106..5eb25d686 100644
--- a/core/corehttp/hostname.go
+++ b/core/corehttp/hostname.go
@@ -55,20 +55,26 @@ func HostnameOption() ServeOption {
if err != nil {
return nil, err
}
Yeah, just dropping the defaults (except localhost) sounds reasonable).
cc @mburns in case removal of implicit config impacts dweb.link deployment scripts
@lidel we were explicit just in case a change like this landed. Thanks for the heads up. 馃殺
Most helpful comment
@lidel we were explicit just in case a change like this landed. Thanks for the heads up. 馃殺