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)