Browse Source

fix: correcting Security scopes when string is given

creating a list explicitly with scopes value when scopes receives a
string
pull/13369/head
Joao-Pedro-P-Holanda 2 months ago
parent
commit
62d92fa5ef
  1. 5
      fastapi/params.py

5
fastapi/params.py

@ -783,4 +783,7 @@ class Security(Depends):
use_cache: bool = True,
):
super().__init__(dependency=dependency, use_cache=use_cache)
self.scopes = scopes or []
if isinstance(scopes, str):
self.scopes = [scopes]
else:
self.scopes = scopes or []

Loading…
Cancel
Save