generic.jsonp raises HTTP(404)

This commit is contained in:
mdipierro
2013-11-24 09:44:08 -06:00
parent 84cc47920b
commit ff2f11a706
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.7.4-stable+timestamp.2013.11.23.21.48.35
Version 2.7.4-stable+timestamp.2013.11.24.09.43.16
+7
View File
@@ -2,6 +2,13 @@
###
# response._vars contains the dictionary returned by the controller action
###
# security check! This file is an example for a jsonp view.
# it is not safe to use as a generic.jsonp because of security implications.
if response.view == 'generic.jsonp':
raise HTTP(501,'generic.jsonp diasbled for security reasons')
try:
from gluon.serializers import json
result = "%s(%s)" % (request.vars['callback'], json(response._vars))