From f71e48ca028bd172e9e9a6b49bca44dfa45bda6f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 21 Jul 2023 17:25:21 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 61ac79d..3b898b7 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -243,8 +243,10 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): self.user = await auth.get_auth(request) self.y_env.user = self.user self.request_filename = self.url2file(str(request.path)) + request['request_filename'] = self.request_filename path = request.path config = getConfig() + request['port'] = config.website.port if config.website.dbadm and path.startswith(config.website.dbadm): pp = path.split('/')[2:] if len(pp)<3: @@ -358,9 +360,10 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): path = request.path if self.request_filename and os.path.isdir(self.request_filename): path = '%s/oops' % path + # print(f'entireUrl():{path=}, {url=},{request["request_filename"]=}') p = self.relatedurl(path,url) scheme = request.headers.get('X-Forwarded-Scheme') or request.scheme - port = request.headers.get('X-Forwarded-Port') or str(request.port) + port = request.headers.get('X-Forwarded-Port') or str(request['port']) return '%s://%s:%s%s' % (scheme, h, port, p) async def path_call(self, request, path, params={}):