From e80b0671c207ffe484376e083204f54495c2d7bc Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 12 Jan 2024 18:03:44 -0500 Subject: [PATCH] frontend: add `charset=utf16` --- core/frontend.py | 28 ++++++++++++++-------------- titles/idac/frontend.py | 2 +- titles/ongeki/frontend.py | 2 +- titles/pokken/frontend.py | 2 +- titles/wacca/frontend.py | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/frontend.py b/core/frontend.py index 7b59fe3..1165015 100644 --- a/core/frontend.py +++ b/core/frontend.py @@ -180,7 +180,7 @@ class FE_Base(): title=self.core_config.server.name, game_list=self.environment.globals["game_list"], sesh=vars(sesh) if sesh is not None else vars(UserSession()), - )) + ), media_type="text/html; charset=utf-16") if sesh is None: resp.delete_cookie("DIANA_SESH") @@ -281,7 +281,7 @@ class FE_Gate(FE_Base): title=f"{self.core_config.server.name} | Login Gate", error=err, sesh=vars(UserSession()), - )) + ), media_type="text/html; charset=utf-16") resp.delete_cookie("DIANA_SESH") return resp @@ -392,7 +392,7 @@ class FE_Gate(FE_Base): title=f"{self.core_config.server.name} | Create User", code=ac, sesh={"user_id": 0, "permissions": 0}, - )) + ), media_type="text/html; charset=utf-16") class FE_User(FE_Base): async def render_GET(self, request: Request): @@ -483,7 +483,7 @@ class FE_User(FE_Base): success=succ, username=user['username'], arcades=arcade_data - )) + ), media_type="text/html; charset=utf-16") async def render_logout(self, request: Request): resp = RedirectResponse("/gate/", 303) @@ -557,7 +557,7 @@ class FE_System(FE_Base): title=f"{self.core_config.server.name} | System", sesh=vars(usr_sesh), usrlist=[], - )) + ), media_type="text/html; charset=utf-16") async def lookup_user(self, request: Request): template = self.environment.get_template("core/templates/sys/index.jinja") @@ -590,7 +590,7 @@ class FE_System(FE_Base): sesh=vars(usr_sesh), usrlist=usrlist, shoplist=[], - )) + ), media_type="text/html; charset=utf-16") async def lookup_shop(self, request: Request): shoplist = [] @@ -624,7 +624,7 @@ class FE_System(FE_Base): usrlist=[], shoplist=shoplist, error=4 - )) + ), media_type="text/html; charset=utf-16") if sn_search: sn_search = sn_search.upper().replace("-", "").strip() @@ -653,7 +653,7 @@ class FE_System(FE_Base): usrlist=[], shoplist=shoplist, error=10 - )) + ), media_type="text/html; charset=utf-16") return Response(template.render( @@ -661,7 +661,7 @@ class FE_System(FE_Base): sesh=vars(usr_sesh), usrlist=[], shoplist=shoplist, - )) + ), media_type="text/html; charset=utf-16") class FE_Arcade(FE_Base): async def render_GET(self, request: Request): @@ -677,14 +677,14 @@ class FE_Arcade(FE_Base): return Response(template.render( title=f"{self.core_config.server.name} | Arcade", sesh=vars(usr_sesh), - )) + ), media_type="text/html; charset=utf-16") sinfo = await self.data.arcade.get_arcade(shop_id) if not sinfo: return Response(template.render( title=f"{self.core_config.server.name} | Arcade", sesh=vars(usr_sesh), - )) + ), media_type="text/html; charset=utf-16") cabs = await self.data.arcade.get_arcade_machines(shop_id) cablst = [] @@ -705,7 +705,7 @@ class FE_Arcade(FE_Base): "cabs": cablst } - )) + ), media_type="text/html; charset=utf-16") class FE_Machine(FE_Base): async def render_GET(self, request: Request): @@ -721,13 +721,13 @@ class FE_Machine(FE_Base): return Response(template.render( title=f"{self.core_config.server.name} | Machine", sesh=vars(usr_sesh), - )) + ), media_type="text/html; charset=utf-16") return Response(template.render( title=f"{self.core_config.server.name} | Machine", sesh=vars(usr_sesh), arcade={} - )) + ), media_type="text/html; charset=utf-16") cfg_dir = environ.get("DIANA_CFG_DIR", "config") cfg: CoreConfig = CoreConfig() diff --git a/titles/idac/frontend.py b/titles/idac/frontend.py index e331a24..1441833 100644 --- a/titles/idac/frontend.py +++ b/titles/idac/frontend.py @@ -141,4 +141,4 @@ class IDACFrontend(FE_Base): rank=rank, sesh=vars(usr_sesh), active_page="idac", - )) + ), media_type="text/html; charset=utf-16") diff --git a/titles/ongeki/frontend.py b/titles/ongeki/frontend.py index 24b4071..310e8f6 100644 --- a/titles/ongeki/frontend.py +++ b/titles/ongeki/frontend.py @@ -64,7 +64,7 @@ class OngekiFrontend(FE_Base): version_list=self.version_list, version=self.version, sesh=vars(usr_sesh) - )) + ), media_type="text/html; charset=utf-16") else: return RedirectResponse("/gate/", 303) diff --git a/titles/pokken/frontend.py b/titles/pokken/frontend.py index 5672ffb..9fb9ccf 100644 --- a/titles/pokken/frontend.py +++ b/titles/pokken/frontend.py @@ -74,7 +74,7 @@ class PokkenFrontend(FE_Base): profile=pf, error=err, success=succ - )) + ), media_type="text/html; charset=utf-16") async def change_name(self, request: Request) -> RedirectResponse: usr_sesh = self.validate_session(request) diff --git a/titles/wacca/frontend.py b/titles/wacca/frontend.py index 973c50b..5151f97 100644 --- a/titles/wacca/frontend.py +++ b/titles/wacca/frontend.py @@ -43,4 +43,4 @@ class WaccaFrontend(FE_Base): title=f"{self.core_config.server.name} | {self.nav_name}", game_list=self.environment.globals["game_list"], sesh=vars(usr_sesh) - )) \ No newline at end of file + ), media_type="text/html; charset=utf-16") \ No newline at end of file