From 038e3cccdf94f8c1dbba2790676ce0d5ae7c7160 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 5 Apr 2020 09:47:13 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 548fb50..14c9f87 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -153,7 +153,7 @@ class ProcessorResource(StaticResource,Url2File): return g.myi18n(s,l) def gethost(): - return '/'.join(request.url.split('/')[:3]) + return '/'.join(str(request.url).split('/')[:3]) async def getArgs(): ns = DictObject() @@ -203,6 +203,10 @@ class ProcessorResource(StaticResource,Url2File): processor = Klass(self.abspath(path),self) return await processor.handle(request) print(f'path={path} handler by StaticResource..') + if self.isFolder(path): + config = getConfig() + if not config.website.allowListFolder: + Raise HTTPNotFound return await super()._handle(request) def absUrl(self,request,url):