This commit is contained in:
yumoqing 2020-04-05 09:47:13 +08:00
parent 07b7aa9b1d
commit 038e3cccdf

View File

@ -153,7 +153,7 @@ class ProcessorResource(StaticResource,Url2File):
return g.myi18n(s,l) return g.myi18n(s,l)
def gethost(): def gethost():
return '/'.join(request.url.split('/')[:3]) return '/'.join(str(request.url).split('/')[:3])
async def getArgs(): async def getArgs():
ns = DictObject() ns = DictObject()
@ -203,6 +203,10 @@ class ProcessorResource(StaticResource,Url2File):
processor = Klass(self.abspath(path),self) processor = Klass(self.abspath(path),self)
return await processor.handle(request) return await processor.handle(request)
print(f'path={path} handler by StaticResource..') 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) return await super()._handle(request)
def absUrl(self,request,url): def absUrl(self,request,url):