pre-commit-ci-lite[bot]
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
1 deletions
-
fastapi/routing.py
-
tests/test_apirouter_mount.py
|
|
|
@ -1506,7 +1506,9 @@ class APIRouter(routing.Router): |
|
|
|
) |
|
|
|
elif isinstance(route, routing.Mount): |
|
|
|
if isinstance(route.app, StaticFiles): |
|
|
|
self._mount(prefix + router.prefix + route.path, route.app, name=route.name) |
|
|
|
self._mount( |
|
|
|
prefix + router.prefix + route.path, route.app, name=route.name |
|
|
|
) |
|
|
|
for handler in router.on_startup: |
|
|
|
self.add_event_handler("startup", handler) |
|
|
|
for handler in router.on_shutdown: |
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
"""Tests for mounting StaticFiles under APIRouter (issue #10180).""" |
|
|
|
|
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
import pytest |
|
|
|
|