mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
Require JSON APIs are requested with a .json extension.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user