[ mailman-Patches-912448 ] Config setting to force relative URLs

SourceForge.net noreply at sourceforge.net
Mon Mar 8 21:57:58 EST 2004


Patches item #912448, was opened at 2004-03-09 02:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300103&aid=912448&group_id=103

Category: None
Group: Mailman 2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Kostecke (kostecke)
Assigned to: Nobody/Anonymous (nobody)
Summary: Config setting to force relative URLs

Initial Comment:
Mailman 2.1.1 uses absolute URLs for all references to
mailing lists. This behavior may be useful when one
Mailman installation runs lists on multiple virtual
hosts. However, this behavior reduces the flexibility
of Mailman by making it impossible to use Mailman in
configurations where you need to be able to use
different hostnames to refer to the same lists (e.g.
where HTTP and HTTPS use different virtual hosts).

This patch modifies the ScriptURL function in
./Mailman/Utils.py to allow relative URLs to be forced
by setting a mm_cfg configuration variable:
RELATIVE_URLS. This patch also modifies Defaults.py to
provide the default value for RELATIVE_URLS.

<pre>
--- Utils.py.orig       Tue Mar  9 02:45:20 2004
+++ Utils.py    Tue Mar  9 02:10:51 2004
@@ -238,7 +238,7 @@
         fullpath = os.environ.get(&#039;SCRIPT_NAME&#039;, &#039;&#039;) +                     os.environ.get(&#039;PATH_INFO&#039;, &#039;&#039;)
     baseurl = urlparse.urlparse(web_page_url)[2]
-    if not absolute and fullpath.endswith(baseurl):
+    if mm_cfg.RELATIVE_URLS or not absolute and
fullpath.endswith(baseurl):
         # Use relative addressing
         fullpath = fullpath[len(baseurl):]
         i = fullpath.find(&#039;?&#039;)

--- Defaults.py.orig    Tue Mar  9 02:44:44 2004
+++ Defaults.py Tue Mar  9 02:15:13 2004
@@ -782,6 +782,9 @@
 # list&#039;s config variable default_member_moderation.
 DEFAULT_NEW_MEMBER_OPTIONS = 256
 
+# Set this to 1 to enable relative URLs.
+RELATIVE_URLS = 0

 #####
 # List defaults.  NOTE: Changing these values does NOT
change the
</pre>


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300103&aid=912448&group_id=103



More information about the Mailman-coders mailing list