fixes #3382
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class SourcesController < ApplicationController
|
||||
respond_to :json, :xml
|
||||
rescue_from Sources::Site::NoStrategyError, :with => :no_strategy
|
||||
|
||||
def show
|
||||
@source = Sources::Site.new(params[:url], :referer_url => params[:ref])
|
||||
@@ -9,4 +10,10 @@ class SourcesController < ApplicationController
|
||||
format.xml { render xml: @source.to_h.to_xml(root: "source") }
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def no_strategy
|
||||
render json: {message: "Unsupported site"}.to_json, status: 400
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user