misc: attach a copy of environment to requests (#24058)

This commit is contained in:
Frédéric Péters 2018-05-24 17:31:47 +02:00
parent 832a34c032
commit 3cd48901e7
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
import base64
import copy
import re
from quixote import get_session, get_publisher
@ -35,6 +36,9 @@ class HTTPRequest(quixote.http_request.HTTPRequest):
self.is_json_marker = None
self.ignore_session = False
self.wscalls_cache = {}
# keep a copy of environment to make sure it's not reused along
# uwsgi/gunicorn processes.
self.environ = copy.copy(self.environ)
_user = () # use empty tuple instead of None as None is a "valid" user value
def get_user(self):