prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: StaticFiles sends files as `content-disposition: 'attachment'` in html-mode
  **Describe the bug**
  When using `StaticFiles` in html-mode, files are being sent with `content-disposition: 'attachment'`
  
  **To Reproduce**
  Create an `html/index.html` file. Run:
  
  ```python
  from starlite import Starlite, StaticFilesConfig, TestClient
  
  app = Starlite(
      static_files_config=[StaticFilesConfig(path="/", directories=["html"], html_mode=True)], route_handlers=[]
  )
  
  with TestClient(app=app) as client:
      res = client.get("/index.html")
      assert not res.headers["content-disposition"].startswith("attachment")
  ```
  
  Bug: StaticFiles sends files as `content-disposition: 'attachment'` in html-mode
  **Describe the bug**
  When using `StaticFiles` in html-mode, files are being sent with `content-disposition: 'attachment'`
  
  **To Reproduce**
  Create an `html/index.html` file. Run:
  
  ```python
  from starlite import Starlite, StaticFilesConfig, TestClient
  
  app = Starlite(
      static_files_config=[StaticFilesConfig(path="/", directories=["html"], html_mode=True)], route_handlers=[]
  )
  
  with TestClient(app=app) as client:
      res = client.get("/index.html")
      assert not res.headers["content-disposition"].startswith("attachment")
  ```
  
  
  </issue>
  <code>
  [start of starlite/static_files/base.py]
  1 from os.path import commonpath, join
  2 from typing import TYPE_CHECKING, List, Tuple, Union
  3 
  4 from starlite.enums import ScopeType
  5 from starlite.exceptions import MethodNotAllowedException, NotFoundException
  6 from starlite.response import FileResponse
  7 from starlite.status_codes import HTTP_404_NOT_FOUND
  8 from starlite.utils.file import FileSystemAdapter
  9 
  10 if TYPE_CHECKING:
  11 
  12     from starlite.types import Receive, Scope, Send
  13     from starlite.types.composite_types import PathType
  14     from starlite.types.file_types import FileInfo, FileSystemProtocol
  15 
  16 
  17 class StaticFiles:
  18     __slots__ = ("is_html_mode", "directories", "adapter")
  19 
  20     def __init__(self, is_html_mode: bool, directories: List["PathType"], file_system: "FileSystemProtocol") -> None:
  21         """This class is an ASGI App that handles file sending.
  22 
  23         Args:
  24             is_html_mode: Flag dictating whether serving html. If true, the default file will be 'index.html'.
  25             directories: A list of directories to serve files from.
  26             file_system: The file_system spec to use for serving files.
  27         """
  28         self.adapter = FileSystemAdapter(file_system)
  29         self.directories = directories
  30         self.is_html_mode = is_html_mode
  31 
  32     async def get_fs_info(
  33         self, directories: List["PathType"], file_path: str
  34     ) -> Union[Tuple[str, "FileInfo"], Tuple[None, None]]:
  35         """Resolves the file path and returns the resolved path and a.
  36 
  37         [stat_result][os.stat_result].
  38 
  39         Args:
  40             directories: A list of directory paths.
  41             file_path: A file path to resolve
  42 
  43         Returns:
  44             A tuple with an optional resolved [Path][anyio.Path] instance and an optional [stat_result][os.stat_result].
  45         """
  46         for directory in directories:
  47             try:
  48                 joined_path = join(directory, file_path)  # noqa: PL118
  49                 file_info = await self.adapter.info(joined_path)
  50                 if file_info and commonpath([str(directory), file_info["name"], joined_path]) == str(directory):
  51                     return joined_path, file_info
  52             except FileNotFoundError:
  53                 continue
  54         return None, None
  55 
  56     async def __call__(self, scope: "Scope", receive: "Receive", send: "Send") -> None:
  57         if scope["type"] != ScopeType.HTTP or scope["method"] not in {"GET", "HEAD"}:
  58             raise MethodNotAllowedException()
  59 
  60         split_path = scope["path"].split("/")
  61         filename = split_path[-1]
  62         joined_path = join(*split_path)  # noqa: PL118
  63         resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=joined_path)
  64 
  65         if fs_info and fs_info["type"] == "directory" and self.is_html_mode:
  66             filename = "index.html"
  67             resolved_path, fs_info = await self.get_fs_info(
  68                 directories=self.directories, file_path=join(resolved_path or joined_path, filename)
  69             )
  70 
  71         if fs_info and fs_info["type"] == "file":
  72             await FileResponse(
  73                 path=resolved_path or joined_path,
  74                 file_info=fs_info,
  75                 file_system=self.adapter.file_system,
  76                 filename=filename,
  77                 is_head_response=scope["method"] == "HEAD",
  78             )(scope, receive, send)
  79             return
  80 
  81         if self.is_html_mode:
  82             filename = "404.html"
  83             resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=filename)
  84             if fs_info and fs_info["type"] == "file":
  85                 await FileResponse(
  86                     path=resolved_path or joined_path,
  87                     file_info=fs_info,
  88                     file_system=self.adapter.file_system,
  89                     filename=filename,
  90                     is_head_response=scope["method"] == "HEAD",
  91                     status_code=HTTP_404_NOT_FOUND,
  92                 )(scope, receive, send)
  93                 return
  94 
  95         raise NotFoundException(f"no file or directory match the path {resolved_path or joined_path} was found")
  96
  [end of starlite/static_files/base.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/starlite/static_files/base.py b/starlite/static_files/base.py
  --- a/starlite/static_files/base.py
  +++ b/starlite/static_files/base.py
  @@ -8,6 +8,7 @@
   from starlite.utils.file import FileSystemAdapter
   
   if TYPE_CHECKING:
  +    from typing_extensions import Literal
   
       from starlite.types import Receive, Scope, Send
       from starlite.types.composite_types import PathType
  @@ -61,12 +62,15 @@
           filename = split_path[-1]
           joined_path = join(*split_path)  # noqa: PL118
           resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=joined_path)
  +        content_disposition_type: "Literal['inline', 'attachment']" = "attachment"
   
  -        if fs_info and fs_info["type"] == "directory" and self.is_html_mode:
  -            filename = "index.html"
  -            resolved_path, fs_info = await self.get_fs_info(
  -                directories=self.directories, file_path=join(resolved_path or joined_path, filename)
  -            )
  +        if self.is_html_mode:
  +            content_disposition_type = "inline"
  +            if fs_info and fs_info["type"] == "directory":
  +                filename = "index.html"
  +                resolved_path, fs_info = await self.get_fs_info(
  +                    directories=self.directories, file_path=join(resolved_path or joined_path, filename)
  +                )
   
           if fs_info and fs_info["type"] == "file":
               await FileResponse(
  @@ -75,6 +79,7 @@
                   file_system=self.adapter.file_system,
                   filename=filename,
                   is_head_response=scope["method"] == "HEAD",
  +                content_disposition_type=content_disposition_type,
               )(scope, receive, send)
               return
   
  @@ -89,6 +94,7 @@
                       filename=filename,
                       is_head_response=scope["method"] == "HEAD",
                       status_code=HTTP_404_NOT_FOUND,
  +                    content_disposition_type=content_disposition_type,
                   )(scope, receive, send)
                   return
  
verification_info: {"golden_diff": "diff --git a/starlite/static_files/base.py b/starlite/static_files/base.py\n--- a/starlite/static_files/base.py\n+++ b/starlite/static_files/base.py\n@@ -8,6 +8,7 @@\n from starlite.utils.file import FileSystemAdapter\n \n if TYPE_CHECKING:\n+    from typing_extensions import Literal\n \n     from starlite.types import Receive, Scope, Send\n     from starlite.types.composite_types import PathType\n@@ -61,12 +62,15 @@\n         filename = split_path[-1]\n         joined_path = join(*split_path)  # noqa: PL118\n         resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=joined_path)\n+        content_disposition_type: \"Literal['inline', 'attachment']\" = \"attachment\"\n \n-        if fs_info and fs_info[\"type\"] == \"directory\" and self.is_html_mode:\n-            filename = \"index.html\"\n-            resolved_path, fs_info = await self.get_fs_info(\n-                directories=self.directories, file_path=join(resolved_path or joined_path, filename)\n-            )\n+        if self.is_html_mode:\n+            content_disposition_type = \"inline\"\n+            if fs_info and fs_info[\"type\"] == \"directory\":\n+                filename = \"index.html\"\n+                resolved_path, fs_info = await self.get_fs_info(\n+                    directories=self.directories, file_path=join(resolved_path or joined_path, filename)\n+                )\n \n         if fs_info and fs_info[\"type\"] == \"file\":\n             await FileResponse(\n@@ -75,6 +79,7 @@\n                 file_system=self.adapter.file_system,\n                 filename=filename,\n                 is_head_response=scope[\"method\"] == \"HEAD\",\n+                content_disposition_type=content_disposition_type,\n             )(scope, receive, send)\n             return\n \n@@ -89,6 +94,7 @@\n                     filename=filename,\n                     is_head_response=scope[\"method\"] == \"HEAD\",\n                     status_code=HTTP_404_NOT_FOUND,\n+                    content_disposition_type=content_disposition_type,\n                 )(scope, receive, send)\n                 return\n", "issue": "Bug: StaticFiles sends files as `content-disposition: 'attachment'` in html-mode\n**Describe the bug**\r\nWhen using `StaticFiles` in html-mode, files are being sent with `content-disposition: 'attachment'`\r\n\r\n**To Reproduce**\r\nCreate an `html/index.html` file. Run:\r\n\r\n```python\r\nfrom starlite import Starlite, StaticFilesConfig, TestClient\r\n\r\napp = Starlite(\r\n    static_files_config=[StaticFilesConfig(path=\"/\", directories=[\"html\"], html_mode=True)], route_handlers=[]\r\n)\r\n\r\nwith TestClient(app=app) as client:\r\n    res = client.get(\"/index.html\")\r\n    assert not res.headers[\"content-disposition\"].startswith(\"attachment\")\r\n```\r\n\nBug: StaticFiles sends files as `content-disposition: 'attachment'` in html-mode\n**Describe the bug**\r\nWhen using `StaticFiles` in html-mode, files are being sent with `content-disposition: 'attachment'`\r\n\r\n**To Reproduce**\r\nCreate an `html/index.html` file. Run:\r\n\r\n```python\r\nfrom starlite import Starlite, StaticFilesConfig, TestClient\r\n\r\napp = Starlite(\r\n    static_files_config=[StaticFilesConfig(path=\"/\", directories=[\"html\"], html_mode=True)], route_handlers=[]\r\n)\r\n\r\nwith TestClient(app=app) as client:\r\n    res = client.get(\"/index.html\")\r\n    assert not res.headers[\"content-disposition\"].startswith(\"attachment\")\r\n```\r\n\n", "before_files": [{"content": "from os.path import commonpath, join\nfrom typing import TYPE_CHECKING, List, Tuple, Union\n\nfrom starlite.enums import ScopeType\nfrom starlite.exceptions import MethodNotAllowedException, NotFoundException\nfrom starlite.response import FileResponse\nfrom starlite.status_codes import HTTP_404_NOT_FOUND\nfrom starlite.utils.file import FileSystemAdapter\n\nif TYPE_CHECKING:\n\n    from starlite.types import Receive, Scope, Send\n    from starlite.types.composite_types import PathType\n    from starlite.types.file_types import FileInfo, FileSystemProtocol\n\n\nclass StaticFiles:\n    __slots__ = (\"is_html_mode\", \"directories\", \"adapter\")\n\n    def __init__(self, is_html_mode: bool, directories: List[\"PathType\"], file_system: \"FileSystemProtocol\") -> None:\n        \"\"\"This class is an ASGI App that handles file sending.\n\n        Args:\n            is_html_mode: Flag dictating whether serving html. If true, the default file will be 'index.html'.\n            directories: A list of directories to serve files from.\n            file_system: The file_system spec to use for serving files.\n        \"\"\"\n        self.adapter = FileSystemAdapter(file_system)\n        self.directories = directories\n        self.is_html_mode = is_html_mode\n\n    async def get_fs_info(\n        self, directories: List[\"PathType\"], file_path: str\n    ) -> Union[Tuple[str, \"FileInfo\"], Tuple[None, None]]:\n        \"\"\"Resolves the file path and returns the resolved path and a.\n\n        [stat_result][os.stat_result].\n\n        Args:\n            directories: A list of directory paths.\n            file_path: A file path to resolve\n\n        Returns:\n            A tuple with an optional resolved [Path][anyio.Path] instance and an optional [stat_result][os.stat_result].\n        \"\"\"\n        for directory in directories:\n            try:\n                joined_path = join(directory, file_path)  # noqa: PL118\n                file_info = await self.adapter.info(joined_path)\n                if file_info and commonpath([str(directory), file_info[\"name\"], joined_path]) == str(directory):\n                    return joined_path, file_info\n            except FileNotFoundError:\n                continue\n        return None, None\n\n    async def __call__(self, scope: \"Scope\", receive: \"Receive\", send: \"Send\") -> None:\n        if scope[\"type\"] != ScopeType.HTTP or scope[\"method\"] not in {\"GET\", \"HEAD\"}:\n            raise MethodNotAllowedException()\n\n        split_path = scope[\"path\"].split(\"/\")\n        filename = split_path[-1]\n        joined_path = join(*split_path)  # noqa: PL118\n        resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=joined_path)\n\n        if fs_info and fs_info[\"type\"] == \"directory\" and self.is_html_mode:\n            filename = \"index.html\"\n            resolved_path, fs_info = await self.get_fs_info(\n                directories=self.directories, file_path=join(resolved_path or joined_path, filename)\n            )\n\n        if fs_info and fs_info[\"type\"] == \"file\":\n            await FileResponse(\n                path=resolved_path or joined_path,\n                file_info=fs_info,\n                file_system=self.adapter.file_system,\n                filename=filename,\n                is_head_response=scope[\"method\"] == \"HEAD\",\n            )(scope, receive, send)\n            return\n\n        if self.is_html_mode:\n            filename = \"404.html\"\n            resolved_path, fs_info = await self.get_fs_info(directories=self.directories, file_path=filename)\n            if fs_info and fs_info[\"type\"] == \"file\":\n                await FileResponse(\n                    path=resolved_path or joined_path,\n                    file_info=fs_info,\n                    file_system=self.adapter.file_system,\n                    filename=filename,\n                    is_head_response=scope[\"method\"] == \"HEAD\",\n                    status_code=HTTP_404_NOT_FOUND,\n                )(scope, receive, send)\n                return\n\n        raise NotFoundException(f\"no file or directory match the path {resolved_path or joined_path} was found\")\n", "path": "starlite/static_files/base.py"}]}