From 3f2ae0dd62f6dc0f2cf53b2896ba12c0524aa941 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 28 Jul 2023 19:30:30 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 3b898b7..c8d93fb 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -354,16 +354,16 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): def entireUrl(self, request, url): if url.startswith('http://') or url.startswith('https://'): return url + scheme = request.headers.get('X-Forwarded-Scheme') or request.scheme + port = request.headers.get('X-Forwarded-Port') or str(request['port']) h = self.gethost(request) if url.startswith('/'): - return '%s://%s%s' % (request.scheme, h, url) + return f'{scheme}://{h}:{port}{url}' 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']) + return f'{scheme}://{h}:{port}{p}' return '%s://%s:%s%s' % (scheme, h, port, p) async def path_call(self, request, path, params={}):