From 22b766f5b897c7c864373a88f60161cc9c09b680 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 7 Jun 2020 22:55:08 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 8598c48..56b35da 100644 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -68,10 +68,13 @@ class BaseProcessor: await self.datahandle(request) if self.retResponse is not None: return self.retResponse - if type(self.content) == type({}) or isinstance(self.content,DictObject): + elif type(self.content) == type({}) : self.content = json.dumps(self.content, indent=4) - if type(self.content) == type([]): + elif isinstance(self.content,DictObject): + self.content = json.dumps(self.content._kwargs, + indent=4) + elif type(self.content) == type([]): self.content = json.dumps(self.content, indent=4) self.setheaders()