OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
web
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
699 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:40 AM
rwxr-xr-x
📁
_auth
-
03/31/2022 06:22:39 AM
rwxr-xr-x
📄
_element.py
5.81 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_flatten.py
15.54 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_http2.py
48 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
_newclient.py
61.84 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
_responses.py
3.57 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_stan.py
10.54 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
client.py
74.26 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
demo.py
554 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
distrib.py
11.45 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
domhelpers.py
8.44 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
error.py
12.49 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
guard.py
630 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
html.py
1.52 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
http.py
96.91 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
http_headers.py
8.04 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
iweb.py
24.97 KB
03/22/2022 11:03:56 AM
rw-r--r--
📄
microdom.py
35.35 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
proxy.py
9.6 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
resource.py
12.8 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
rewrite.py
1.81 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
script.py
5.61 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
server.py
25.86 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
static.py
35.12 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
sux.py
20.4 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
tap.py
8.73 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
template.py
17.14 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
test
-
03/31/2022 06:22:39 AM
rwxr-xr-x
📄
twcgi.py
11.08 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
util.py
12.12 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
vhost.py
4.36 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
wsgi.py
21.04 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
xmlrpc.py
19.66 KB
09/08/2017 10:38:36 AM
rw-r--r--
Editing: rewrite.py
Close
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.web import resource class RewriterResource(resource.Resource): def __init__(self, orig, *rewriteRules): resource.Resource.__init__(self) self.resource = orig self.rewriteRules = list(rewriteRules) def _rewrite(self, request): for rewriteRule in self.rewriteRules: rewriteRule(request) def getChild(self, path, request): request.postpath.insert(0, path) request.prepath.pop() self._rewrite(request) path = request.postpath.pop(0) request.prepath.append(path) return self.resource.getChildWithDefault(path, request) def render(self, request): self._rewrite(request) return self.resource.render(request) def tildeToUsers(request): if request.postpath and request.postpath[0][:1]=='~': request.postpath[:1] = ['users', request.postpath[0][1:]] request.path = '/'+'/'.join(request.prepath+request.postpath) def alias(aliasPath, sourcePath): """ I am not a very good aliaser. But I'm the best I can be. If I'm aliasing to a Resource that generates links, and it uses any parts of request.prepath to do so, the links will not be relative to the aliased path, but rather to the aliased-to path. That I can't alias static.File directory listings that nicely. However, I can still be useful, as many resources will play nice. """ sourcePath = sourcePath.split('/') aliasPath = aliasPath.split('/') def rewriter(request): if request.postpath[:len(aliasPath)] == aliasPath: after = request.postpath[len(aliasPath):] request.postpath = sourcePath + after request.path = '/'+'/'.join(request.prepath+request.postpath) return rewriter