travis-api/lib/travis/api/app/responders
Piotr Sarnacki 61142c7cf6 Return 404 unless we can find API builder for resource
In order to protect us from rendering a resource simply converted to
json, without processing it with API data class, this commit changes
JSON responder behavior to render 404 if we can't find associated data
class. The only exception to that rule is when resource is already a
Hash, meaning that it was processed before - we sometimes return for
example simple Hash responses like { result: true }.

The Hash exception could allow to accidentally pass resource.as_json to
responder, but in travis-ci/travis-support@124b8b6 I disabled default
as_json method on AR::Base classes, so the risk of such mistake is
lowered.
2013-03-24 19:49:28 +01:00
..
base.rb Properly handle non existent resources 2013-03-11 23:52:57 +01:00
image.rb Resource can be nil in Responders::Image 2013-03-11 20:57:45 +01:00
json.rb Return 404 unless we can find API builder for resource 2013-03-24 19:49:28 +01:00
plain.rb Allow passing more than one mime type in Accept 2013-02-25 17:27:56 +01:00
service.rb always use etag for caching when cache_key or updated_at are present, add the deploy_sha as a cache buster 2012-12-09 19:22:33 +01:00
xml.rb Don't error out if xml is requested with something else than repo 2013-03-12 12:08:43 +01:00