Skip to content

Commit 0d007c4

Browse files
author
artur.shiriev
committed
review fixes
1 parent f52eb03 commit 0d007c4

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

microbootstrap/bootstrappers/litestar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def bootstrap_before(self) -> dict[str, typing.Any]:
9292
return {
9393
"cors_config": LitestarCorsConfig(
9494
allow_origins=self.instrument_config.cors_allowed_origins,
95-
allow_methods=self.instrument_config.cors_allowed_methods, # type: ignore[arg-type]
95+
allow_methods=self.instrument_config.cors_allowed_methods,
9696
allow_headers=self.instrument_config.cors_allowed_headers,
9797
allow_credentials=self.instrument_config.cors_allowed_credentials,
9898
allow_origin_regex=self.instrument_config.cors_allowed_origin_regex,

microbootstrap/instruments/cors_instrument.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from __future__ import annotations
2+
import typing
23

34
import pydantic
5+
from litestar.types import Method # noqa: TC002
46

57
from microbootstrap.instruments.base import BaseInstrumentConfig, Instrument
68

79

810
class CorsConfig(BaseInstrumentConfig):
911
cors_allowed_origins: list[str] = pydantic.Field(default_factory=list)
10-
cors_allowed_methods: list[str] = pydantic.Field(default_factory=list)
12+
cors_allowed_methods: list[typing.Literal["*"] | Method] = pydantic.Field(default_factory=list)
1113
cors_allowed_headers: list[str] = pydantic.Field(default_factory=list)
1214
cors_exposed_headers: list[str] = pydantic.Field(default_factory=list)
1315
cors_allowed_credentials: bool = False

microbootstrap/instruments/logging_instrument.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def make_path_with_query_string(scope: ScopeType) -> str:
3232

3333
def fill_log_message(
3434
log_level: str,
35-
request: litestar.Request | fastapi.Request, # type: ignore[type-arg]
35+
request: litestar.Request[typing.Any, typing.Any, typing.Any] | fastapi.Request,
3636
status_code: int,
3737
start_time: int,
3838
) -> None:

0 commit comments

Comments
 (0)