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
- Search Engine Referrer info in request by zenx 3 years, 5 months ago
- Remove self links middleware by svetlyak 4 years, 1 month ago
- Subdomain Middleware by xhenxhe 3 years, 7 months ago
- Simple Paginator Function by goodsanket 2 years, 4 months ago
- Strip Google Analytics cookies for caching middleware purposes by nf 2 years, 7 months ago
Comments
Excellent, thanks!
#