diff options
author | Magnus Hagander | 2020-11-23 10:57:40 +0000 |
---|---|---|
committer | Magnus Hagander | 2020-11-23 10:58:51 +0000 |
commit | ec745db5710d96fdda05e937b73b00bddb89a4c2 (patch) | |
tree | ea6a16d61dab396f22aec7ba9f9e461c49c840ef /pgweb/util/middleware.py | |
parent | e24e987c29b21c310ffbc1b65ce0038fecb32cfa (diff) |
Allow additions to auto-generated xkey tags
If an xkey tag is already set on a response when it reaches the
middleware, add it to the set of automated xkeys generated from the
templates instead of overwriting it.
Diffstat (limited to 'pgweb/util/middleware.py')
-rw-r--r-- | pgweb/util/middleware.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pgweb/util/middleware.py b/pgweb/util/middleware.py index acbb7f3f..1609e001 100644 --- a/pgweb/util/middleware.py +++ b/pgweb/util/middleware.py @@ -40,7 +40,7 @@ class PgMiddleware(object): response['x-do-esi'] = "1" tlist.remove('base/esi.html') if tlist: - response['xkey'] = ' '.join(["pgwt_{0}".format(hashlib.md5(t.encode('ascii', errors='replace')).hexdigest()) for t in tlist]) + response['xkey'] = ' '.join(["pgwt_{0}".format(hashlib.md5(t.encode('ascii', errors='replace')).hexdigest()) for t in tlist] + [response.get('xkey', '')]) # Set security headers sources = OrderedDict([ |