[Checkins] SVN: Sandbox/J1m/resumelb/src/zc/resumelb/lb. Make disconnect paramterer html, so apps can have full control over

Jim Fulton jim at zope.com
Fri Jan 27 12:45:56 UTC 2012


Log message for revision 124214:
  Make disconnect paramterer html, so apps can have full control over
  markup.
  

Changed:
  U   Sandbox/J1m/resumelb/src/zc/resumelb/lb.py
  U   Sandbox/J1m/resumelb/src/zc/resumelb/lb.test

-=-
Modified: Sandbox/J1m/resumelb/src/zc/resumelb/lb.py
===================================================================
--- Sandbox/J1m/resumelb/src/zc/resumelb/lb.py	2012-01-27 12:43:09 UTC (rev 124213)
+++ Sandbox/J1m/resumelb/src/zc/resumelb/lb.py	2012-01-27 12:45:55 UTC (rev 124214)
@@ -16,10 +16,12 @@
 
 retry_methods = set(('GET', 'HEAD'))
 
-default_disconnect_message = """
+default_disconnect_message = '''
+<html><meta http-equiv="refresh" content="1"><body>
 The server was unable to handle your request due to a transient failure.
 Please try again.
-"""
+</body></html>
+'''
 
 class LB:
 
@@ -76,8 +78,7 @@
                     return webob.Response(
                         status = '502 Bad Gateway',
                         content_type= 'text/html',
-                        body = ("<html><body>%s</body></html>"
-                                % self.disconnect_message)
+                        body = self.disconnect_message
                         )(env, start_response)
 
 class Pool:

Modified: Sandbox/J1m/resumelb/src/zc/resumelb/lb.test
===================================================================
--- Sandbox/J1m/resumelb/src/zc/resumelb/lb.test	2012-01-27 12:43:09 UTC (rev 124213)
+++ Sandbox/J1m/resumelb/src/zc/resumelb/lb.test	2012-01-27 12:45:55 UTC (rev 124214)
@@ -265,17 +265,19 @@
     ...    print repr(g.value)
     <200 OK text/html body='Hello test\n'>
     <200 OK text/html no body>
-    <502 Bad Gateway text/html body='<html><bo...tml>'/118>
-    <502 Bad Gateway text/html body='<html><bo...tml>'/118>
-    <502 Bad Gateway text/html body='<html><bo...tml>'/118>
-    <502 Bad Gateway text/html body='<html><bo...tml>'/118>
-    <502 Bad Gateway text/html body='<html><bo...tml>'/118>
+    <502 Bad Gateway text/html body='\n<html><...l>\n'/159>
+    <502 Bad Gateway text/html body='\n<html><...l>\n'/159>
+    <502 Bad Gateway text/html body='\n<html><...l>\n'/159>
+    <502 Bad Gateway text/html body='\n<html><...l>\n'/159>
+    <502 Bad Gateway text/html body='\n<html><...l>\n'/159>
 
     >>> print greenlets[2].value.body
-    <html><body>
+    <BLANKLINE>
+    <html><meta http-equiv="refresh" content="1"><body>
     The server was unable to handle your request due to a transient failure.
     Please try again.
     </body></html>
+    <BLANKLINE>
 
 Automatic reconnection
 ======================



More information about the checkins mailing list