[pacman-dev,2/3] pmserve: allow serving byte objects directly

Message ID 20210427025715.39514-2-andrew.gregory.8@gmail.com
State New
Headers show
Series [pacman-dev,1/3] pmpkg: add makepkg_bytes | expand

Commit Message

Andrew Gregory April 27, 2021, 2:57 a.m. UTC
Useful for serving in-memory package files.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
---
 test/pacman/pmserve.py | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/test/pacman/pmserve.py b/test/pacman/pmserve.py
index 47e041d0..b6de9797 100644
--- a/test/pacman/pmserve.py
+++ b/test/pacman/pmserve.py
@@ -78,6 +78,8 @@  def do_GET(self):
                         response.get('body', ''),
                         headers=response.get('headers', {}),
                         code=response.get('code', 200))
+            elif isinstance(response, bytes):
+                self.respond_bytes(response)
             else:
                 self.respond_string(response)
         else: