https_everywhere enabled by default

This commit is contained in:
Lionel Dricot 2022-01-24 16:50:22 +01:00
parent 2e7d213c26
commit 682631c4cd
1 changed files with 8 additions and 1 deletions

View File

@ -768,6 +768,7 @@ class GeminiClient(cmd.Cmd):
"gopher_proxy" : None,
"tls_mode" : "tofu",
"http_proxy": None,
"https_everywhere": True
}
self.log = {
@ -814,7 +815,7 @@ However, you can use `set gopher_proxy hostname:port` to tell it about a
Gopher-to-Gemini proxy (such as a running Agena instance), in which case
you'll be able to transparently follow links to Gopherspace!""")
return
if gi.scheme == "mailto":
elif gi.scheme == "mailto":
if handle and not self.sync_only:
resp = input("Send an email to %s Y/N? " %gi.path)
self.gi = gi
@ -831,6 +832,12 @@ you'll be able to transparently follow links to Gopherspace!""")
new_gi = GeminiItem(self.permanent_redirects[gi.url], name=gi.name)
self._go_to_gi(new_gi)
return
if gi.scheme == "http" and self.options["https_everywhere"] :
newurl = "https" + gi.url[4:]
new_gi = GeminiItem(newurl,name=gi.name)
self._go_to_gi(new_gi)
return
# Use cache or mark as to_fetch if resource is not cached
# Why is this code useful ? It set the mimetype !