bugfix
This commit is contained in:
parent
cd2742f144
commit
1700dbe546
@ -137,7 +137,6 @@ class TemplateProcessor(BaseProcessor):
|
|||||||
n_path = self.resource.url2path(url)
|
n_path = self.resource.url2path(url)
|
||||||
ns = self.run_ns
|
ns = self.run_ns
|
||||||
te = self.run_ns['tmpl_engine']
|
te = self.run_ns['tmpl_engine']
|
||||||
print(f'TemplateProcessor:path_call():{url=}, {path=}, {n_path=}, {self.path=}')
|
|
||||||
# return await te.render(url,**ns)
|
# return await te.render(url,**ns)
|
||||||
return await te.render(path,**ns)
|
return await te.render(path,**ns)
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
|
|||||||
self._prepath = '/' + self._prepath
|
self._prepath = '/' + self._prepath
|
||||||
|
|
||||||
self._preurl = f'{self._scheme}://{self._host}:{self._port}{self._prepath}'
|
self._preurl = f'{self._scheme}://{self._host}:{self._port}{self._prepath}'
|
||||||
print(f'{request.path=}, {self._preurl=}')
|
# print(f'{request.path=}, {self._preurl=}')
|
||||||
|
|
||||||
|
|
||||||
async def _handle(self,request:Request) -> StreamResponse:
|
async def _handle(self,request:Request) -> StreamResponse:
|
||||||
@ -410,12 +410,12 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
|
|||||||
return url
|
return url
|
||||||
if url.startswith('/'):
|
if url.startswith('/'):
|
||||||
u = f'{self._preurl}{url}'
|
u = f'{self._preurl}{url}'
|
||||||
print(f'entireUrl(), {u=}, {url=}, {self._preurl=}')
|
# print(f'entireUrl(), {u=}, {url=}, {self._preurl=}')
|
||||||
return u
|
return u
|
||||||
path = request.path
|
path = request.path
|
||||||
p = self.relatedurl(path,url)
|
p = self.relatedurl(path,url)
|
||||||
u = f'{self._preurl}{p}'
|
u = f'{self._preurl}{p}'
|
||||||
print(f'entireUrl(), {u=}, {url=}, {self._preurl=}')
|
# print(f'entireUrl(), {u=}, {url=}, {self._preurl=}')
|
||||||
return u
|
return u
|
||||||
|
|
||||||
def url2path(self, url):
|
def url2path(self, url):
|
||||||
@ -425,12 +425,11 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
|
|||||||
|
|
||||||
async def path_call(self, request, path, params={}):
|
async def path_call(self, request, path, params={}):
|
||||||
url = self.entireUrl(request, path)
|
url = self.entireUrl(request, path)
|
||||||
print(f'{path=}, after entireUrl(), {url=}')
|
# print(f'{path=}, after entireUrl(), {url=}')
|
||||||
path = self.url2path(url)
|
path = self.url2path(url)
|
||||||
fpath = self.url2file(path)
|
fpath = self.url2file(path)
|
||||||
processor = self.url2processor(request, path, fpath)
|
processor = self.url2processor(request, path, fpath)
|
||||||
print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}, {self._prepath}')
|
# print(f'path_call(), {path=}, {url=}, {fpath=}, {processor=}, {self._prepath}')
|
||||||
new_request = request.clone(rel_url=path)
|
new_request = request.clone(rel_url=path)
|
||||||
# new_request.path = path
|
|
||||||
return await processor.be_call(new_request, params=params)
|
return await processor.be_call(new_request, params=params)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user