From 166e92f7ffd282735077e2e3b8e43c77d161b07d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 19 Feb 2024 12:06:22 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index aea2829..c93f5e5 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -409,23 +409,27 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): url.startswith('wss://'): return url if url.startswith('/'): - return f'{self._prepath}{url}' + u = f'{self._preurl}{url}' + print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') + return u path = request.path p = self.relatedurl(path,url) - return f'{self._prepath}{p}' + u = f'{self._preurl}{p}' + print(f'entireUrl(), {u=}, {url=}, {self._preurl=}') + return u def url2path(self, url): - if url.startswith(self._prepath): - return url[len(self._prepath):] + if url.startswith(self._preurl): + return url[len(self._preurl):] return url async def path_call(self, request, path, params={}): url = self.entireUrl(request, path) - # print(f'{path=}, after entireUrl(), {url=}') - path = self.url2path(url) + print(f'{path=}, after entireUrl(), {url=}') + # path = self.url2path(url) fpath = self.url2file(path) - processor = self.url2processor(request, url, fpath) - print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}') + processor = self.url2processor(request, path, fpath) + print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}, {self._prepath}') new_request = request.clone(rel_url=url) # new_request.path = path return await processor.be_call(new_request, params=params)