annotate examples/tutorial/geddit/lib/ajax.py @ 655:b090bf737111

The `striptags` function now also removes HTML/XML-style comments. Closes #150. Thanks to Armin Ronacher for the report and suggested fix.
author cmlenz
date Thu, 22 Nov 2007 19:43:05 +0000
parents dba522b4c31d
children
rev   line source
625
dba522b4c31d GenshiTutorial: implemented AJAX commenting.
cmlenz
parents:
diff changeset
1 import cherrypy
dba522b4c31d GenshiTutorial: implemented AJAX commenting.
cmlenz
parents:
diff changeset
2
dba522b4c31d GenshiTutorial: implemented AJAX commenting.
cmlenz
parents:
diff changeset
3 def is_xhr():
dba522b4c31d GenshiTutorial: implemented AJAX commenting.
cmlenz
parents:
diff changeset
4 requested_with = cherrypy.request.headers.get('X-Requested-With')
dba522b4c31d GenshiTutorial: implemented AJAX commenting.
cmlenz
parents:
diff changeset
5 return requested_with and requested_with.lower() == 'xmlhttprequest'
Copyright (C) 2012-2017 Edgewall Software