Skip to content

Commit 4fac029

Browse files
committed
fix: resposne types
1 parent 01aa260 commit 4fac029

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

frameworks/Python/litestar/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def multiple_database_queries(queries: Any = None) -> Response:
9494
)
9595

9696

97-
@get("/fortunes", media_type=MediaType.TEXT)
97+
@get("/fortunes", media_type=MediaType.HTML)
9898
async def fortunes(request: Request) -> Template:
9999
async with app.state.connection_pool.acquire() as connection:
100100
fortunes = await connection.fetch("SELECT * FROM Fortune")
@@ -104,7 +104,7 @@ async def fortunes(request: Request) -> Template:
104104
return Template(
105105
"fortune.html",
106106
context={"fortunes": fortunes, "request": request},
107-
media_type=MediaType.TEXT,
107+
media_type=MediaType.HTML,
108108
)
109109

110110

frameworks/Python/litestar/app_orm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def multiple_database_queries(queries: Any = None) -> Response:
126126
)
127127

128128

129-
@get("/fortunes", media_type=MediaType.TEXT)
129+
@get("/fortunes", media_type=MediaType.HTML)
130130
async def fortunes(request: Request) -> Template:
131131
async with app.state.db_session() as sess:
132132
ret = await sess.execute(select(Fortune.id, Fortune.message))
@@ -138,7 +138,7 @@ async def fortunes(request: Request) -> Template:
138138
return Template(
139139
"fortune.jinja",
140140
context={"request": request, "fortunes": data},
141-
media_type=MediaType.TEXT,
141+
media_type=MediaType.HTML,
142142
)
143143

144144

0 commit comments

Comments
 (0)