navigation: fix minor issues with URLs
This commit is contained in:
parent
85570de5a8
commit
657d46adc5
|
@ -33,7 +33,7 @@ class CommandLine:
|
|||
self.window.addstr(command_char + prefix)
|
||||
curses.curs_set(1)
|
||||
try:
|
||||
command = self.textbox.edit(validator)[1:]
|
||||
command = self.textbox.edit(validator)[1:].strip()
|
||||
except EscapeCommandInterrupt:
|
||||
command = ""
|
||||
except TerminateCommandInterrupt as exc:
|
||||
|
|
|
@ -20,7 +20,7 @@ def parse_url(url: str, absolute: bool =False):
|
|||
if url.startswith("gemini://"):
|
||||
url = url[7:]
|
||||
parts = urllib.parse.urlparse(url, scheme="gemini")
|
||||
if not parts.netloc and absolute:
|
||||
if not parts.netloc or absolute:
|
||||
parts = urllib.parse.urlparse(f"//{url}", scheme="gemini")
|
||||
return parts
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ class Request:
|
|||
|
||||
try:
|
||||
sock = socket.create_connection((hostname, port))
|
||||
except socket.gaierror as exc:
|
||||
except OSError as exc:
|
||||
self.state = Request.STATE_CONNECTION_FAILED
|
||||
self.error = exc.strerror
|
||||
return False
|
||||
|
|
Reference in a new issue