Attachment 'modpy_script.patch'
Download 1 * looking for arch@arch.thinkmo.de--2003-archives/moin--main--1.3--patch-704 to compare with
2 * comparing to arch@arch.thinkmo.de--2003-archives/moin--main--1.3--patch-704
3 M MoinMoin/request.py
4
5 * modified files
6
7 --- orig/MoinMoin/request.py
8 +++ mod/MoinMoin/request.py
9 @@ -1699,12 +1699,41 @@
10 env=dict(req.subprocess_env)
11 else:
12 env=req.subprocess_env
13 + # Must be called BEFORE _setup_vars_from_std_env
14 + self.fixScriptNameAndPathInfo(env)
15 self._setup_vars_from_std_env(env)
16 RequestBase.__init__(self)
17
18 except error.FatalError, err:
19 self.fail(err)
20
21 + def fixScriptNameAndPathInfo(self, env):
22 + """ Set script_name and path_info using httpd config
23 +
24 + When configuring using Apache <location> directive and path
25 + like /a/b/c, the only way to set correct script_name and
26 + path_info is to pass the required script_name using
27 + PythonOption. See example configuration:
28 +
29 + <Location /url/to/mywiki>
30 + PythonOption Location /url/to/mywiki
31 + </location>
32 +
33 + Must be called before self._setup_vars_from_std_env
34 + """
35 + location = self.mpyreq.get_options().get('Location')
36 + if location is not None:
37 + restoredURI = env['SCRIPT_NAME'] + env['PATH_INFO']
38 + if not restoredURI.startswith(location):
39 + message = '''Wrong "PythonOption Location %s".
40 +
41 +PythonOption Location value should match Apache Location directive. Fix
42 +and restart Apache.
43 +''' % location
44 + raise error.ConfigurationError(message)
45 + env['SCRIPT_NAME'] = location
46 + env['PATH_INFO'] = restoredURI[len(location):]
47 +
48 def setup_args(self, form=None):
49 """ Sets up args by using mod_python.util.FieldStorage, which
50 is different to cgi.FieldStorage. So we need a separate
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.