We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8b013f7 + 1f2dd32 commit 51eff7bCopy full SHA for 51eff7b
nbviewer/app.py
@@ -458,6 +458,13 @@ def default_endpoint(self):
458
if "JUPYTERHUB_SERVICE_URL" in os.environ:
459
url = urlparse(os.environ["JUPYTERHUB_SERVICE_URL"])
460
default_host, default_port = url.hostname, url.port
461
+
462
+ if default_port < 1 or default_port > 65535:
463
+ self.log.error(
464
+ "Received invalid port number %d through JUPYTERHUB_SERVICE_URL. "
465
+ "Defaulting to 5000 instead."
466
+ )
467
+ default_port = 5000
468
else:
469
default_host, default_port = "0.0.0.0", 5000
470
return {"host": default_host, "port": default_port}
0 commit comments