diff --git a/server.py b/server.py index 64ca3e626..4b4265f01 100644 --- a/server.py +++ b/server.py @@ -158,7 +158,7 @@ async def _exc_handler(request: Request, exc: Exception, template_name: str): def github_url_for_exc(exc: Exception) -> str | None: base_dir = str(settings.BASE_DIR) - ref = os.environ.get("CAPROVER_GIT_COMMIT_SHA") or "master" + ref = (os.environ.get("CAPROVER_GIT_COMMIT_SHA") or "master").strip() for frame in reversed(traceback.extract_tb(exc.__traceback__)): if not frame.filename.startswith(base_dir): continue