Require JSON APIs are requested with a .json extension.

This commit is contained in:
Max Goodman
2011-08-27 15:46:11 -07:00
parent c280c6aca1
commit 16d74d3684

View File

@@ -189,6 +189,8 @@ def textresponse(self, self_method, responder, simple_vals, param_vals, *a, **kw
@api_validate()
def json_validate(self, self_method, responder, simple_vals, param_vals, *a, **kw):
if c.extension != 'json':
abort(404)
r = self_method(self, *a, **kw)
return self.api_wrapper(r)