This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new c132679  Use a wrapper for shell script responses
c132679 is described below

commit c13267928e5ab5076aeb89f415692cc9c5c2048c
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Oct 27 20:25:35 2025 +0000

    Use a wrapper for shell script responses
---
 atr/routes/download.py | 2 +-
 atr/web.py             | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/atr/routes/download.py b/atr/routes/download.py
index e7fec63..d92c727 100644
--- a/atr/routes/download.py
+++ b/atr/routes/download.py
@@ -96,7 +96,7 @@ async def sh_selected(
     download_path = util.as_url(path, project_name=project_name, 
version_name=version_name, file_path="")
     content = content.replace("[URL_OF_URLS]", 
f"https://{app_host}{download_urls_selected}";)
     content = content.replace("[URLS_PREFIX]", 
f"https://{app_host}{download_path}";)
-    return quart.Response(content, mimetype="text/x-shellscript")
+    return web.ShellResponse(content)
 
 
 @route.public("/download/urls/<project_name>/<version_name>")
diff --git a/atr/web.py b/atr/web.py
index 442e9e6..a71f7fe 100644
--- a/atr/web.py
+++ b/atr/web.py
@@ -212,6 +212,11 @@ class RouteFunction(Protocol[R]):
     def __call__(self, *args: Any, **kwargs: Any) -> Awaitable[R]: ...
 
 
+class ShellResponse(quart.Response):
+    def __init__(self, text: str, status: int = 200) -> None:
+        super().__init__(text, status=status, mimetype="text/x-shellscript")
+
+
 class TextResponse(quart.Response):
     def __init__(self, text: str, status: int = 200) -> None:
         super().__init__(text, status=status, mimetype="text/plain")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to