Commits

mitsuhiko  committed c349d38

Added proxy and memory settings.

  • Participants
  • Parent commits c7a8d51

Comments (0)

Files changed (2)

File solace/application.py

     _locale = None
     _pulled_flash_messages = None
 
+    #: each request might transmit up to four megs of payload that
+    #: is stored in memory.  If more is transmitted, Werkzeug will
+    #: abort the request with an appropriate status code.  This should
+    #: not happen unless someone really tempers with the data.
+    max_form_memory_size = 4 * 1024 * 1024
+
     def __init__(self, environ):
         RequestBase.__init__(self, environ)
         before_request_init.emit()
         return SecureCookie.load_cookie(self, settings.COOKIE_NAME,
                                         settings.SECRET_KEY)
 
+    @property
+    def is_behind_proxy(self):
+        """Are we behind a proxy?  Accessed by Werkzeug when needed."""
+        return settings.IS_BEHIND_PROXY
+
     def list_languages(self):
         """Lists all languages."""
         return [dict(

File solace/settings.py

     IS_MODERATOR=10000
 )
 
+#: if solace is used behind a proxy, this is better set to true to
+#: let the system know to interpret proxy headers.  For security
+#: reasons you should not set this if you are *not* deploying behind
+#: a proxy.
+IS_BEHIND_PROXY = False
+
 
 def configure(**values):
     """Configuration shortcut."""