summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2021-04-27 04:34:14 +0200
committerAllan McRae <allan@archlinux.org>2021-05-01 04:08:14 +0200
commit8faf749fd19aff0eb35eb7108d2fd379d3c9c3b9 (patch)
treee0ebf9319592c8817e844cc208e5ee4bc0b751ab /test
parentab622b4881e6b971c62de4323c72c87a6da51323 (diff)
downloadpacman-8faf749fd19aff0eb35eb7108d2fd379d3c9c3b9.tar.gz
pacman-8faf749fd19aff0eb35eb7108d2fd379d3c9c3b9.tar.xz
pmserve: allow serving byte objects directly
Useful for serving in-memory package files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmserve.py2
1 files changed, 2 insertions, 0 deletions
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 @@ class pmStringHTTPRequestHandler(pmHTTPRequestHandler):
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: