Merge branch 'master' of aewens/0x0 into master

This commit is contained in:
Ben Harris 2018-10-03 19:37:33 -04:00 committed by Gitea
commit fd78aabe07
1 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,12 @@ def store_file(f, addr):
def store_url(url, addr):
if is_fhost_url(url):
return segfault(508)
# handler to convert gopher links to HTTP(S) proxy
gopher = "gopher://"
if url[:len(gopher)] = gopher:
address = url.split(gopher, 1)[1]
url = "https://gopher.tilde.team/{}".format(address)
h = { "Accept-Encoding" : "identity" }
r = requests.get(url, stream=True, verify=False, headers=h)