travis-api/lib/travis/api/app
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
..
endpoint Fix link to travis-web 2013-03-03 18:27:29 -06:00
extensions pass if scope does not match 2013-01-13 20:08:56 +01:00
helpers Allow to pass version as Accept param 2013-02-25 17:28:24 +01:00
middleware Allow passing more than one mime type in Accept 2013-02-25 17:27:56 +01:00
responders Return 404 unless we can find API builder for resource 2013-03-24 19:49:28 +01:00
access_token.rb add travis_token scope 2012-12-12 17:11:25 +01:00
base.rb disable new relic 2013-02-13 17:55:11 +01:00
cors.rb Move CORS middleware in front of the stack 2012-11-05 21:48:13 +01:00
endpoint.rb use Services::Helpers 2012-11-23 21:16:21 +01:00
extensions.rb rewrite all the things 2012-07-27 15:55:57 +02:00
helpers.rb rewrite all the things 2012-07-27 15:55:57 +02:00
middleware.rb rename Responder to Base (resembles Sinatra::Base and i can't come up with another name for a common base class of Middleware and Endpoint) 2012-10-09 18:31:51 +02:00
responders.rb Allow to download logs in plain text 2013-01-15 02:23:02 +01:00