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.
1 parent 769b36b commit d6d8710Copy full SHA for d6d8710
shiny/http_staticfiles.py
@@ -43,7 +43,7 @@ def file_response(
43
**kwargs: Any,
44
) -> starlette.responses.Response:
45
resp = super().file_response(full_path, *args, **kwargs)
46
- if resp.headers["content-type"].startswith("text/plain"):
+ if resp.headers.get("content-type", "").startswith("text/plain"):
47
correct_type = _utils.guess_mime_type(full_path)
48
resp.headers["content-type"] = (
49
f"{correct_type}; charset={resp.charset}"
0 commit comments