1
0

Added my little whining on always empty scheme in a comment on NetworkType() func.

This commit is contained in:
Alexander Andreev 2022-02-11 03:06:40 +04:00
parent d56620ea9e
commit 1cb4ba8c5c
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -15,6 +15,9 @@ func MainSite(host string) string {
// NetworkType detects network based on host suffix, // NetworkType detects network based on host suffix,
// whether client connected from Tor, I2P or Clearnet. // whether client connected from Tor, I2P or Clearnet.
// Holy shit, net/http/Response doesn't actually save
// a URL.Scheme and just spit out an empty string.
// What a shame.
func NetworkType(host string) (string, string) { func NetworkType(host string) (string, string) {
if strings.Contains(host, "i2p") { if strings.Contains(host, "i2p") {
return "i2p", "http" return "i2p", "http"