prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [BUG] Fiftyone v0.21.6 localhost Not found, while v0.21.4 Could not connect session, despite working before 7Aug23
  ### System information
  
  -   **OS Platform and Distribution** (`Windows 11 Pro, build 22621.2134`)
  -  **Google Chrome** (`Version 115.0.5790.171 (Official Build) (64-bit)`)
  -   **Python version** (`python --version 3.10.0`)
  -   **FiftyOne version** (`fiftyone --version 0.21.4`)
  -   **FiftyOne installed from** (`pip`)
  
  ### Commands to reproduce
  
  I have my own custom Python script (including option to run fiftyone's quickstart) working for weeks at least until 7 Aug 2023. I'm unable to share the custom scripts.
  
  Today (17 Aug 2023), as I run through installing fiftyone and running my scripts, I encounter the following problems.
  
  I had a few updates to Google Chrome browser in these 10 days too.
  
  ### Describe the problem
  
  Here's what i've tried.
  
  Scenario A: fiftyone v0.21.6
  Problem: `App launched. Point your browser to http://localhost:5151`. But unable to load App page at localhost 5151 ("Not found" displayed on page)
  Solutions tried but did not work: [Registry settings](https://github.com/voxel51/fiftyone/issues/2010) and/or [mimetype](https://github.com/voxel51/fiftyone/issues/2522#issuecomment-1416318362)
  
  Scenario B: fiftyone v0.21.4
  Problem: unable to fully display the App (it only shows the fiftyone skeleton page with "Select Dataset", and no layout and data in the middle). The terminal repeatedly gives `could not connect session, retrying in 10 seconds`.
  
  I'm unsure what is the cause to the above and would appreciate your assistance. 
  
  ### What areas of FiftyOne does this bug affect?
  
  -   [x] `App`: FiftyOne application issue
  -   [ ] `Core`: Core Python library issue
  -   [ ] `Server`: FiftyOne server issue
  
  ### Willingness to contribute
  
  The FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?
  
  -   [ ] Yes. I can contribute a fix for this bug independently
  -   [ ] Yes. I would be willing to contribute a fix for this bug with guidance from the FiftyOne community
  -   [x] No. I cannot contribute a bug fix at this time
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `fiftyone/server/app.py`
  Content:
  ```
  1 """
  2 FiftyOne Server app.
  3 
  4 | Copyright 2017-2023, Voxel51, Inc.
  5 | `voxel51.com <https://voxel51.com/>`_
  6 |
  7 """
  8 from datetime import date, datetime
  9 import os
  10 import pathlib
  11 
  12 import eta.core.utils as etau
  13 from starlette.applications import Starlette
  14 from starlette.middleware import Middleware
  15 from starlette.middleware.base import (
  16     BaseHTTPMiddleware,
  17     RequestResponseEndpoint,
  18 )
  19 from starlette.middleware.cors import CORSMiddleware
  20 from starlette.requests import Request
  21 from starlette.responses import Response
  22 from starlette.routing import Mount, Route
  23 from starlette.staticfiles import StaticFiles
  24 from starlette.types import Scope
  25 import strawberry as gql
  26 
  27 import fiftyone as fo
  28 import fiftyone.constants as foc
  29 from fiftyone.server.context import GraphQL
  30 from fiftyone.server.extensions import EndSession
  31 from fiftyone.server.mutation import Mutation
  32 from fiftyone.server.query import Query
  33 from fiftyone.server.routes import routes
  34 from fiftyone.server.scalars import Date, DateTime
  35 
  36 
  37 etau.ensure_dir(os.path.join(os.path.dirname(__file__), "static"))
  38 
  39 
  40 class Static(StaticFiles):
  41     async def get_response(self, path: str, scope: Scope) -> Response:
  42         response = await super().get_response(path, scope)
  43 
  44         if response.status_code == 404:
  45             path = pathlib.Path(
  46                 *pathlib.Path(path).parts[2:]
  47             )  # strip dataset/{name}
  48             response = await super().get_response(path, scope)
  49             if response.status_code == 404:
  50                 full_path, stat_result = self.lookup_path("index.html")
  51                 return self.file_response(full_path, stat_result, scope)
  52 
  53         return response
  54 
  55 
  56 class HeadersMiddleware(BaseHTTPMiddleware):
  57     async def dispatch(
  58         self, request: Request, call_next: RequestResponseEndpoint
  59     ) -> Response:
  60         response = await call_next(request)
  61         response.headers["x-colab-notebook-cache-control"] = "no-cache"
  62         return response
  63 
  64 
  65 schema = gql.Schema(
  66     mutation=Mutation,
  67     query=Query,
  68     extensions=[EndSession],
  69     scalar_overrides={
  70         date: Date,
  71         datetime: DateTime,
  72     },
  73 )
  74 
  75 
  76 app = Starlette(
  77     middleware=[
  78         Middleware(
  79             CORSMiddleware,
  80             allow_origins=["*"],
  81             allow_methods=["GET", "POST", "HEAD", "OPTIONS"],
  82             allow_headers=[
  83                 "access-control-allow-origin",
  84                 "authorization",
  85                 "content-type",
  86             ],
  87         ),
  88         Middleware(HeadersMiddleware),
  89     ],
  90     debug=foc.DEV_INSTALL,
  91     routes=[Route(route, endpoint) for route, endpoint in routes]
  92     + [
  93         Route(
  94             "/graphql",
  95             GraphQL(
  96                 schema,
  97                 graphiql=foc.DEV_INSTALL,
  98             ),
  99         ),
  100         Mount(
  101             "/plugins",
  102             app=Static(
  103                 directory=fo.config.plugins_dir,
  104                 html=True,
  105                 check_dir=False,
  106                 follow_symlink=True,
  107             ),
  108             name="plugins",
  109         ),
  110         Mount(
  111             "/",
  112             app=Static(
  113                 directory=os.path.join(os.path.dirname(__file__), "static"),
  114                 html=True,
  115                 follow_symlink=True,
  116             ),
  117             name="static",
  118         ),
  119     ],
  120 )
  121
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/fiftyone/server/app.py b/fiftyone/server/app.py
  --- a/fiftyone/server/app.py
  +++ b/fiftyone/server/app.py
  @@ -112,7 +112,6 @@
               app=Static(
                   directory=os.path.join(os.path.dirname(__file__), "static"),
                   html=True,
  -                follow_symlink=True,
               ),
               name="static",
           ),
  
verification_info: {"golden_diff": "diff --git a/fiftyone/server/app.py b/fiftyone/server/app.py\n--- a/fiftyone/server/app.py\n+++ b/fiftyone/server/app.py\n@@ -112,7 +112,6 @@\n             app=Static(\n                 directory=os.path.join(os.path.dirname(__file__), \"static\"),\n                 html=True,\n-                follow_symlink=True,\n             ),\n             name=\"static\",\n         ),\n", "issue": "[BUG] Fiftyone v0.21.6 localhost Not found, while v0.21.4 Could not connect session, despite working before 7Aug23\n### System information\r\n\r\n-   **OS Platform and Distribution** (`Windows 11 Pro, build 22621.2134`)\r\n-  **Google Chrome** (`Version 115.0.5790.171 (Official Build) (64-bit)`)\r\n-   **Python version** (`python --version 3.10.0`)\r\n-   **FiftyOne version** (`fiftyone --version 0.21.4`)\r\n-   **FiftyOne installed from** (`pip`)\r\n\r\n### Commands to reproduce\r\n\r\nI have my own custom Python script (including option to run fiftyone's quickstart) working for weeks at least until 7 Aug 2023. I'm unable to share the custom scripts.\r\n\r\nToday (17 Aug 2023), as I run through installing fiftyone and running my scripts, I encounter the following problems.\r\n\r\nI had a few updates to Google Chrome browser in these 10 days too.\r\n\r\n### Describe the problem\r\n\r\nHere's what i've tried.\r\n\r\nScenario A: fiftyone v0.21.6\r\nProblem: `App launched. Point your browser to http://localhost:5151`. But unable to load App page at localhost 5151 (\"Not found\" displayed on page)\r\nSolutions tried but did not work: [Registry settings](https://github.com/voxel51/fiftyone/issues/2010) and/or [mimetype](https://github.com/voxel51/fiftyone/issues/2522#issuecomment-1416318362)\r\n\r\nScenario B: fiftyone v0.21.4\r\nProblem: unable to fully display the App (it only shows the fiftyone skeleton page with \"Select Dataset\", and no layout and data in the middle). The terminal repeatedly gives `could not connect session, retrying in 10 seconds`.\r\n\r\nI'm unsure what is the cause to the above and would appreciate your assistance. \r\n\r\n### What areas of FiftyOne does this bug affect?\r\n\r\n-   [x] `App`: FiftyOne application issue\r\n-   [ ] `Core`: Core Python library issue\r\n-   [ ] `Server`: FiftyOne server issue\r\n\r\n### Willingness to contribute\r\n\r\nThe FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?\r\n\r\n-   [ ] Yes. I can contribute a fix for this bug independently\r\n-   [ ] Yes. I would be willing to contribute a fix for this bug with guidance from the FiftyOne community\r\n-   [x] No. I cannot contribute a bug fix at this time\r\n\n", "before_files": [{"content": "\"\"\"\nFiftyOne Server app.\n\n| Copyright 2017-2023, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nfrom datetime import date, datetime\nimport os\nimport pathlib\n\nimport eta.core.utils as etau\nfrom starlette.applications import Starlette\nfrom starlette.middleware import Middleware\nfrom starlette.middleware.base import (\n    BaseHTTPMiddleware,\n    RequestResponseEndpoint,\n)\nfrom starlette.middleware.cors import CORSMiddleware\nfrom starlette.requests import Request\nfrom starlette.responses import Response\nfrom starlette.routing import Mount, Route\nfrom starlette.staticfiles import StaticFiles\nfrom starlette.types import Scope\nimport strawberry as gql\n\nimport fiftyone as fo\nimport fiftyone.constants as foc\nfrom fiftyone.server.context import GraphQL\nfrom fiftyone.server.extensions import EndSession\nfrom fiftyone.server.mutation import Mutation\nfrom fiftyone.server.query import Query\nfrom fiftyone.server.routes import routes\nfrom fiftyone.server.scalars import Date, DateTime\n\n\netau.ensure_dir(os.path.join(os.path.dirname(__file__), \"static\"))\n\n\nclass Static(StaticFiles):\n    async def get_response(self, path: str, scope: Scope) -> Response:\n        response = await super().get_response(path, scope)\n\n        if response.status_code == 404:\n            path = pathlib.Path(\n                *pathlib.Path(path).parts[2:]\n            )  # strip dataset/{name}\n            response = await super().get_response(path, scope)\n            if response.status_code == 404:\n                full_path, stat_result = self.lookup_path(\"index.html\")\n                return self.file_response(full_path, stat_result, scope)\n\n        return response\n\n\nclass HeadersMiddleware(BaseHTTPMiddleware):\n    async def dispatch(\n        self, request: Request, call_next: RequestResponseEndpoint\n    ) -> Response:\n        response = await call_next(request)\n        response.headers[\"x-colab-notebook-cache-control\"] = \"no-cache\"\n        return response\n\n\nschema = gql.Schema(\n    mutation=Mutation,\n    query=Query,\n    extensions=[EndSession],\n    scalar_overrides={\n        date: Date,\n        datetime: DateTime,\n    },\n)\n\n\napp = Starlette(\n    middleware=[\n        Middleware(\n            CORSMiddleware,\n            allow_origins=[\"*\"],\n            allow_methods=[\"GET\", \"POST\", \"HEAD\", \"OPTIONS\"],\n            allow_headers=[\n                \"access-control-allow-origin\",\n                \"authorization\",\n                \"content-type\",\n            ],\n        ),\n        Middleware(HeadersMiddleware),\n    ],\n    debug=foc.DEV_INSTALL,\n    routes=[Route(route, endpoint) for route, endpoint in routes]\n    + [\n        Route(\n            \"/graphql\",\n            GraphQL(\n                schema,\n                graphiql=foc.DEV_INSTALL,\n            ),\n        ),\n        Mount(\n            \"/plugins\",\n            app=Static(\n                directory=fo.config.plugins_dir,\n                html=True,\n                check_dir=False,\n                follow_symlink=True,\n            ),\n            name=\"plugins\",\n        ),\n        Mount(\n            \"/\",\n            app=Static(\n                directory=os.path.join(os.path.dirname(__file__), \"static\"),\n                html=True,\n                follow_symlink=True,\n            ),\n            name=\"static\",\n        ),\n    ],\n)\n", "path": "fiftyone/server/app.py"}], "after_files": [{"content": "\"\"\"\nFiftyOne Server app.\n\n| Copyright 2017-2023, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nfrom datetime import date, datetime\nimport os\nimport pathlib\n\nimport eta.core.utils as etau\nfrom starlette.applications import Starlette\nfrom starlette.middleware import Middleware\nfrom starlette.middleware.base import (\n    BaseHTTPMiddleware,\n    RequestResponseEndpoint,\n)\nfrom starlette.middleware.cors import CORSMiddleware\nfrom starlette.requests import Request\nfrom starlette.responses import Response\nfrom starlette.routing import Mount, Route\nfrom starlette.staticfiles import StaticFiles\nfrom starlette.types import Scope\nimport strawberry as gql\n\nimport fiftyone as fo\nimport fiftyone.constants as foc\nfrom fiftyone.server.context import GraphQL\nfrom fiftyone.server.extensions import EndSession\nfrom fiftyone.server.mutation import Mutation\nfrom fiftyone.server.query import Query\nfrom fiftyone.server.routes import routes\nfrom fiftyone.server.scalars import Date, DateTime\n\n\netau.ensure_dir(os.path.join(os.path.dirname(__file__), \"static\"))\n\n\nclass Static(StaticFiles):\n    async def get_response(self, path: str, scope: Scope) -> Response:\n        response = await super().get_response(path, scope)\n\n        if response.status_code == 404:\n            path = pathlib.Path(\n                *pathlib.Path(path).parts[2:]\n            )  # strip dataset/{name}\n            response = await super().get_response(path, scope)\n            if response.status_code == 404:\n                full_path, stat_result = self.lookup_path(\"index.html\")\n                return self.file_response(full_path, stat_result, scope)\n\n        return response\n\n\nclass HeadersMiddleware(BaseHTTPMiddleware):\n    async def dispatch(\n        self, request: Request, call_next: RequestResponseEndpoint\n    ) -> Response:\n        response = await call_next(request)\n        response.headers[\"x-colab-notebook-cache-control\"] = \"no-cache\"\n        return response\n\n\nschema = gql.Schema(\n    mutation=Mutation,\n    query=Query,\n    extensions=[EndSession],\n    scalar_overrides={\n        date: Date,\n        datetime: DateTime,\n    },\n)\n\n\napp = Starlette(\n    middleware=[\n        Middleware(\n            CORSMiddleware,\n            allow_origins=[\"*\"],\n            allow_methods=[\"GET\", \"POST\", \"HEAD\", \"OPTIONS\"],\n            allow_headers=[\n                \"access-control-allow-origin\",\n                \"authorization\",\n                \"content-type\",\n            ],\n        ),\n        Middleware(HeadersMiddleware),\n    ],\n    debug=foc.DEV_INSTALL,\n    routes=[Route(route, endpoint) for route, endpoint in routes]\n    + [\n        Route(\n            \"/graphql\",\n            GraphQL(\n                schema,\n                graphiql=foc.DEV_INSTALL,\n            ),\n        ),\n        Mount(\n            \"/plugins\",\n            app=Static(\n                directory=fo.config.plugins_dir,\n                html=True,\n                check_dir=False,\n                follow_symlink=True,\n            ),\n            name=\"plugins\",\n        ),\n        Mount(\n            \"/\",\n            app=Static(\n                directory=os.path.join(os.path.dirname(__file__), \"static\"),\n                html=True,\n            ),\n            name=\"static\",\n        ),\n    ],\n)\n", "path": "fiftyone/server/app.py"}]}