Skip to content

Commit 26a032c

Browse files
committed
cleaning up PR#113
1 parent fd1ecc0 commit 26a032c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jupyter_server/serverapp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,14 +1386,13 @@ def connection_url(self):
13861386
return self.get_url(ip=ip)
13871387

13881388
def get_url(self, ip=None, path=None, token=None):
1389-
"""Build a url for the application.
1390-
"""
1389+
"""Build a url for the application with reasonable defaults."""
13911390
if not ip:
1392-
ip = self.ip
1391+
ip = self.ip if self.ip else 'localhost'
13931392
if not path:
13941393
path = url_path_join(self.base_url, self.default_url)
13951394
# Build query string.
1396-
if self.token:
1395+
if token:
13971396
token = urllib.parse.urlencode({'token': token})
13981397
# Build the URL Parts to dump.
13991398
urlparts = urllib.parse.ParseResult(

0 commit comments

Comments
 (0)