Skip to content

Commit 9e7d2b1

Browse files
committed
fix: empty list assert check and typo
1 parent aa7bc30 commit 9e7d2b1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

config/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
assert YAHOO_API_KEY, "YAHOO_API_KEY environment variable is not set"
99

1010
ALLOWED_HOSTS: list[str] = os.getenv("ALLOWED_HOSTS", "").split(",")
11-
assert ALLOWED_HOSTS, "ALLOWED_HOSTS environment variable is not set"
11+
assert ALLOWED_HOSTS and all(ALLOWED_HOSTS), "ALLOWED_HOSTS environment variable is not set"
1212

1313
ALLOW_ORIGINS: list[str] = os.getenv("ALLOW_ORIGINS", "").split(",")
14-
assert ALLOW_ORIGINS, "ALLOW_ORIGINS environment variable is not set"
14+
assert ALLOW_ORIGINS and all(ALLOW_ORIGINS), "ALLOW_ORIGINS environment variable is not set"
1515

1616
X_API_KEY: str = os.getenv("X_API_KEY", "")
1717
assert X_API_KEY, "X_API_KEY environment variable is not set"

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
7272
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler) # type: ignore
7373
app.add_middleware(SlowAPIMiddleware)
7474

75-
# API Key Header for build API key authentication
75+
# API Key Header for API key authentication
7676
api_key_header = APIKeyHeader(name="X-API-KEY", auto_error=False)
7777

7878

0 commit comments

Comments
 (0)