1 2 3 4 5 6 7 8 9 10 | P3P_COMPACT = 'some string' # I import this from a global constants file
# eg. P3P_COMPACT='CP="CAO DSP CURa ADMa DEVa TAIa CONa OUR DELa BUS IND PHY ONL UNI PUR COM NAV DEM STA"'
class MiddlewareResponseInjectP3P(object):
def __init__(self):
self.process_response = self.inject
def inject(self, request, response):
response['P3P'] = P3P_COMPACT
return response
|
More like this
- P3P Headers for iframes by jeverling 5 years ago
- Avoid IE Brokenness When using Vary and Attachments by axiak 6 years, 2 months ago
- Login Required Middleware with Next Parameter by bernardoporto 7 months, 1 week ago
- nginx x-accel-redirect protection of static files by sean 5 years, 6 months ago
- nested transactions context manager and decorator by demanzano 1 year, 10 months ago
Comments
Excellent, thanks!
#