MCPcopy Create free account
hub / github.com/encode/starlette / file_response

Method file_response

starlette/staticfiles.py:181–193  ·  view source on GitHub ↗
(
        self,
        full_path: PathLike,
        stat_result: os.stat_result,
        scope: Scope,
        status_code: int = 200,
    )

Source from the content-addressed store, hash-verified

179 return "", None
180
181 def file_response(
182 self,
183 full_path: PathLike,
184 stat_result: os.stat_result,
185 scope: Scope,
186 status_code: int = 200,
187 ) -> Response:
188 request_headers = Headers(scope=scope)
189
190 response = FileResponse(full_path, status_code=status_code, stat_result=stat_result)
191 if self.is_not_modified(response.headers, request_headers):
192 return NotModifiedResponse(response.headers)
193 return response
194
195 async def check_config(self) -> None:
196 """

Callers 1

get_responseMethod · 0.95

Calls 4

is_not_modifiedMethod · 0.95
HeadersClass · 0.90
FileResponseClass · 0.90
NotModifiedResponseClass · 0.85

Tested by

no test coverage detected