From 07b7aa9b1d1fa3f27fe317c019b8545a66b64625 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 15 Mar 2020 01:13:03 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index d032910..548fb50 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -152,6 +152,9 @@ class ProcessorResource(StaticResource,Url2File): l = c.langMapping.get(lang,lang) return g.myi18n(s,l) + def gethost(): + return '/'.join(request.url.split('/')[:3]) + async def getArgs(): ns = DictObject() if request.method == 'POST': @@ -166,6 +169,7 @@ class ProcessorResource(StaticResource,Url2File): self.y_env.abspath = self.abspath self.y_env.request2ns = getArgs self.y_env.resource = self + self.y_env.gethost = gethost path = request.path config = getConfig() if config.website.dbrest and path.startswith(config.website.dbrest):