-rwxr-xr-x | scripts/proxy/main.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/proxy/main.py b/scripts/proxy/main.py index 107ba16..8ce4989 100755 --- a/scripts/proxy/main.py +++ b/scripts/proxy/main.py @@ -28,5 +28,8 @@ class ClipperzTestSite(server.Site): def getResourceFor(self, request): - if request.uri.startswith('/json') or request.uri.startswith('/dump'): + uri = request.uri + uri = uri.split("?", 1)[0] + uri = uri.split("#", 1)[0] + if uri.startswith('/json') or uri.startswith('/dump'): request.site = self request.sitepath = copy.copy(request.prepath) @@ -34,5 +37,5 @@ class ClipperzTestSite(server.Site): else: - pathParts = request.uri.split('/') + pathParts = uri.split('/') version = pathParts[1] @@ -41,5 +44,9 @@ class ClipperzTestSite(server.Site): absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2]) result = static.File(absoluteFilePath, contentType) - + elif pathParts[2].endswith('.webapp'): + contentType = 'application/x-web-app-manifest+json' +# absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2]) + absoluteFilePath = os.path.join(projectBaseDir(), 'frontend', version, 'properties', pathParts[2]) + result = static.File(absoluteFilePath, contentType) else: # http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png @@ -55,5 +62,5 @@ class ClipperzTestSite(server.Site): basePath = projectBaseDir() + '/frontend' if resourceType == 'images': - fileExtension = os.path.splitext(request.uri)[1] + fileExtension = os.path.splitext(uri)[1] if fileExtension == '.png': contentType = 'image/png' @@ -76,5 +83,5 @@ class ClipperzTestSite(server.Site): contentType = 'text/html' - absoluteFilePath = basePath + request.uri + absoluteFilePath = basePath + uri result = static.File(absoluteFilePath, contentType) @@ -86,5 +93,5 @@ class ClipperzTestSite(server.Site): def main (): - site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8084, '/java-backend')) + site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8080, '/java-backend')) reactor.listenTCP(8888, site) reactor.run() |