From 05b96e89aba4011ceac65b4c0750aba5c5cc49ff Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 17 Feb 2024 19:26:53 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index bf942cf..a625a94 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -384,15 +384,17 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): return url scheme = request.headers.get('X-Forwarded-Scheme') or request.scheme port = request.headers.get('X-Forwarded-Port') or str(request['port']) + prepath = request.headers.get('X-Forwarded-Prepath') or '' + if prepath != '': + prepath = f'/{prepath}' h = self.gethost(request) if url.startswith('/'): - return f'{scheme}://{h}:{port}{url}' + return f'{scheme}://{h}:{port}{url}{prepath}' path = request.path if self.request_filename and os.path.isdir(self.request_filename): path = '%s/oops' % path p = self.relatedurl(path,url) - return f'{scheme}://{h}:{port}{p}' - return '%s://%s:%s%s' % (scheme, h, port, p) + return f'{scheme}://{h}:{port}{prepath}{p}' async def path_call(self, request, path, params={}): url = self.entireUrl(request, path)