how to set p3p header in python
https://github.com/jjanssen/django-p3p
Django P3P makes it easier to set P3P HTTP headers to prevent session loss. — Read more
2 months ago
http://djangosnippets.org/snippets/786/
P3P Headers for iframes
1 2 3 4 | def index(request):
response = render_to_response('mytemplate.html')
response["P3P"] = 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'
return response
|
More like this
- Compact P3P policy header injection middleware by mwolgemuth 3 years, 11 months ago
- Avoid IE Brokenness When using Vary and Attachments by axiak 5 years, 5 months ago
- Extended db cache backend with 'filter() / LIKE' support (and now scheduled cache clean!) by sleepycal 2 years, 8 months ago
- Internet Explorer Redirect Decorator by johnboxall 3 years, 11 months ago
- Foreign Key list_filter wthout custom FilterSpec by haileris23 2 years, 7 months ago
http://djangosnippets.org/snippets/1084/
Compact P3P policy header injection middleware
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 4 years, 3 months ago
- Avoid IE Brokenness When using Vary and Attachments by axiak 5 years, 5 months ago
- nginx x-accel-redirect protection of static files by sean 4 years, 9 months ago
- nested transactions context manager and decorator by demanzano 1 year ago
- Login Required Middleware by onecreativenerd 3 years, 10 months ago
No comments:
Post a Comment