Set json content type only when content type is not set
This commit is contained in:
parent
b529f61675
commit
c194f25a24
|
@ -14,7 +14,7 @@ class Travis::Api::App
|
|||
|
||||
# TODO hmmm?
|
||||
before { flash.clear }
|
||||
before { content_type :json }
|
||||
after { content_type :json unless content_type }
|
||||
|
||||
error(ActiveRecord::RecordNotFound, Sinatra::NotFound) { not_found }
|
||||
not_found { content_type =~ /json/ ? { 'file' => 'not found' } : 'file not found' }
|
||||
|
|
Loading…
Reference in New Issue
Block a user