Merge pull request #774 from niphlod/fix/issue_769

fixes #769
This commit is contained in:
mdipierro
2015-02-05 18:09:50 -06:00
4 changed files with 22 additions and 15 deletions
+15 -9
View File
@@ -29,9 +29,9 @@ from gluon import recfile
import hashlib
import portalocker
try:
import cPickle as pickle
import cPickle as pickle
except:
import pickle
import pickle
from pickle import Pickler, MARK, DICT, EMPTY_DICT
from types import DictionaryType
import cStringIO
@@ -234,7 +234,8 @@ class Request(Storage):
dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
try:
post_vars.update(dpost)
except: pass
except:
pass
if query_string is not None:
env['QUERY_STRING'] = query_string
# The same detection used by FieldStorage to detect multipart POSTs
@@ -332,8 +333,8 @@ class Request(Storage):
and secures the session.
"""
cmd_opts = global_settings.cmd_options
#checking if this is called within the scheduler or within the shell
#in addition to checking if it's not a cronjob
# checking if this is called within the scheduler or within the shell
# in addition to checking if it's not a cronjob
if ((cmd_opts and (cmd_opts.shell or cmd_opts.scheduler))
or global_settings.cronjob or self.is_https):
current.session.secure()
@@ -394,7 +395,7 @@ class Response(Storage):
self._custom_commit = None
self._custom_rollback = None
self.generic_patterns = ['*']
self.delimiters = ('{{','}}')
self.delimiters = ('{{', '}}')
self.formstyle = 'table3cols'
self.form_label_separator = ': '
@@ -490,7 +491,11 @@ class Response(Storage):
for item in files:
if isinstance(item, str):
f = item.lower().split('?')[0]
if self.static_version:
# if static_version we need also to check for
# static_version_urls. In that case, the _.x.x.x
# bit would have already been added by the URL()
# function
if self.static_version and not self.static_version_urls:
item = item.replace(
'/static/', '/static/_%s/' % self.static_version, 1)
if f.endswith('.css'):
@@ -698,7 +703,7 @@ class Response(Storage):
DIV(BEAUTIFY(current.response), backtotop,
_class="w2p-toolbar-hidden", _id="response-%s" % u),
DIV(BEAUTIFY(dbtables), backtotop,
_class="w2p-toolbar-hidden",_id="db-tables-%s" % u),
_class="w2p-toolbar-hidden", _id="db-tables-%s" % u),
DIV(BEAUTIFY(dbstats), backtotop,
_class="w2p-toolbar-hidden", _id="db-stats-%s" % u),
SCRIPT("jQuery('.w2p-toolbar-hidden').hide()"),
@@ -1007,7 +1012,7 @@ class Session(Storage):
elif self._secure and response.session_id_name in rcookies:
rcookies[response.session_id_name]['secure'] = True
def clear_session_cookies(sefl):
def clear_session_cookies(self):
request = current.request
response = current.response
session = response.session
@@ -1189,6 +1194,7 @@ class Session(Storage):
except:
pass
def pickle_session(s):
return Session, (dict(s),)