Commits

Jesper Nøhr  committed 55efadd

blinding patching emitters.py, fixes #104

  • Participants
  • Parent commits 3690538

Comments (0)

Files changed (1)

File piston/emitters.py

     JSON emitter, understands timestamps.
     """
     def render(self, request):
-        cb = request.GET.get('callback')
+        cb = request.GET.get('callback', None)
         seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
 
         # Callback
-        if is_valid_jsonp_callback_value(cb):
+        if cb and is_valid_jsonp_callback_value(cb):
             return '%s(%s)' % (cb, seria)
 
         return seria