Skip to content

Commit

Permalink
Add pdf extension to static routes
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Dec 27, 2024
1 parent 11dc14b commit 2715bf8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fasthtml/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def reg_re_param(m, s):
# %% ../nbs/api/00_core.ipynb
# Starlette doesn't have the '?', so it chomps the whole remaining URL
reg_re_param("path", ".*?")
reg_re_param("static", "ico|gif|jpg|jpeg|webm|css|js|woff|png|svg|mp4|webp|ttf|otf|eot|woff2|txt|html|map")
reg_re_param("static", "ico|gif|jpg|jpeg|webm|css|js|woff|png|svg|mp4|webp|ttf|otf|eot|woff2|txt|html|map|pdf")

@patch
def static_route_exts(self:FastHTML, prefix='/', static_path='.', exts='static'):
Expand Down
2 changes: 1 addition & 1 deletion nbs/api/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,7 @@
"#| export\n",
"# Starlette doesn't have the '?', so it chomps the whole remaining URL\n",
"reg_re_param(\"path\", \".*?\")\n",
"reg_re_param(\"static\", \"ico|gif|jpg|jpeg|webm|css|js|woff|png|svg|mp4|webp|ttf|otf|eot|woff2|txt|html|map\")\n",
"reg_re_param(\"static\", \"ico|gif|jpg|jpeg|webm|css|js|woff|png|svg|mp4|webp|ttf|otf|eot|woff2|txt|html|map|pdf\")\n",
"\n",
"@patch\n",
"def static_route_exts(self:FastHTML, prefix='/', static_path='.', exts='static'):\n",
Expand Down

0 comments on commit 2715bf8

Please sign in to comment.