[Inteproxy-commits] r298 - trunk

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 18 10:03:57 CET 2010


Author: iweinzierl
Date: 2010-11-18 10:03:55 +0100 (Thu, 18 Nov 2010)
New Revision: 298

Modified:
   trunk/ChangeLog
   trunk/create-rewrite-rules.py
Log:
Changed the regular expression that is used to create the substitute rule.

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-11-03 09:42:00 UTC (rev 297)
+++ trunk/ChangeLog	2010-11-18 09:03:55 UTC (rev 298)
@@ -1,3 +1,10 @@
+2010-11-18  Ingo Weinzierl <ingo at intevation.de>
+
+	* create-rewrite-rules.py: Changed the regular expression that is used
+	to create the substitute rule. The url in the substitute rule needs to
+	end with a quote. This prevents ignoring the rest of the line when
+	the first matching url is found.
+
 2010-11-03  Bjoern Schilberg <bjoern at intevation.de>
 
 	* website/index-de.htm4, website/index.htm4: Updated file paths

Modified: trunk/create-rewrite-rules.py
===================================================================
--- trunk/create-rewrite-rules.py	2010-11-03 09:42:00 UTC (rev 297)
+++ trunk/create-rewrite-rules.py	2010-11-18 09:03:55 UTC (rev 298)
@@ -32,8 +32,9 @@
         print >>sys.stderr, ("Missing credentials for url %r"
                              % orig_url)
         return None, None
-    host_regex = pattern_to_regex(rule.host, character_set="[^/]")
-    path_regex = pattern_to_regex(rule.path, character_set=".")
+    host_regex       = pattern_to_regex(rule.host, character_set="[^/]")
+    path_regex       = pattern_to_regex(rule.path, character_set=".")
+    subst_path_regex = pattern_to_regex(rule.path, character_set='[^"]')
     port_regex = ""
     if rule.port is not None:
         port_regex = re.escape(":%d" % rule.port)
@@ -41,7 +42,7 @@
             % (host_regex, port_regex, path_regex,
                re.escape(quote_plus(rule.user)),
                re.escape(quote_plus(rule.password))))
-    subst_regex = host_regex + port_regex + path_regex
+    subst_regex = host_regex + port_regex + subst_path_regex
     return rule, subst_regex
 
 def substitution_rule(regexes, prefix):



More information about the Inteproxy-commits mailing list