Skip to content

Commit

Permalink
feat: update overriding mimetype
Browse files Browse the repository at this point in the history
```console
$ fava bcs/main.bc -p 5001  # <- python 3.12
Invalid mimetype set for '.js', overriding
Starting Fava on http://127.0.0.1:5001
```

- `mimetype` sometimes broken on windows: <python/cpython#97646>
- use `text/javascript`: <beancount#1446>
  • Loading branch information
m9810223 committed Nov 6, 2023
1 parent e23773e commit e4728fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fava/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@
]


if mimetypes.types_map.get(".js") != "application/javascript":
if not mimetypes.types_map.get(".js", "").endswith("/javascript"):
# This is sometimes broken on windows, see
# https://github.com/beancount/fava/issues/1446
logging.error("Invalid mimetype set for '.js', overriding")
mimetypes.add_type("application/javascript", ".js")
mimetypes.add_type("text/javascript", ".js")


def _ledger_slugs_dict(ledgers: Iterable[FavaLedger]) -> dict[str, FavaLedger]:
Expand Down

0 comments on commit e4728fc

Please sign in to comment.