Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2df7a1
)
python: Absolutify WSGI SCRIPT_FILENAME path.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 23 Oct 2010 15:06:42 +0000
(17:06 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 23 Oct 2010 15:06:42 +0000
(17:06 +0200)
python/ashd-wsgi
patch
|
blob
|
blame
|
history
diff --git
a/python/ashd-wsgi
b/python/ashd-wsgi
index
e8f8435
..
422fc9f
100755
(executable)
--- a/
python/ashd-wsgi
+++ b/
python/ashd-wsgi
@@
-36,6
+36,12
@@
else:
sys.exit(1)
handler = handlermod.application
sys.exit(1)
handler = handlermod.application
+cwd = os.getcwd()
+def absolutify(path):
+ if path[0] != '/':
+ return os.path.join(cwd, path)
+ return path
+
def dowsgi(req):
env = {}
env["wsgi.version"] = 1, 0
def dowsgi(req):
env = {}
env["wsgi.version"] = 1, 0
@@
-63,7
+69,7
@@
def dowsgi(req):
if "X-Ash-Address" in req: env["REMOTE_ADDR"] = req["X-Ash-Address"]
if "Content-Type" in req: env["CONTENT_TYPE"] = req["Content-Type"]
if "Content-Length" in req: env["CONTENT_LENGTH"] = req["Content-Length"]
if "X-Ash-Address" in req: env["REMOTE_ADDR"] = req["X-Ash-Address"]
if "Content-Type" in req: env["CONTENT_TYPE"] = req["Content-Type"]
if "Content-Length" in req: env["CONTENT_LENGTH"] = req["Content-Length"]
- if "X-Ash-File" in req: env["SCRIPT_FILENAME"] =
req["X-Ash-File"]
+ if "X-Ash-File" in req: env["SCRIPT_FILENAME"] =
absolutify(req["X-Ash-File"])
if "X-Ash-Protocol" in req: env["wsgi.url_scheme"] = req["X-Ash-Protocol"]
env["wsgi.input"] = req.sk
env["wsgi.errors"] = sys.stderr
if "X-Ash-Protocol" in req: env["wsgi.url_scheme"] = req["X-Ash-Protocol"]
env["wsgi.input"] = req.sk
env["wsgi.errors"] = sys.stderr