Files
danbooru/app/controllers/sources_controller.rb
evazion 935cefd27e API: on error, include backtrace in json response.
Incidentally fixes issue with error responses inside /sources.json not
including the usual `{"success": false}`.
2017-03-16 18:11:43 -05:00

13 lines
308 B
Ruby

class SourcesController < ApplicationController
respond_to :json, :xml
def show
@source = Sources::Site.new(params[:url], :referer_url => params[:ref])
@source.get
respond_with(@source.to_h) do |format|
format.xml { render xml: @source.to_h.to_xml(root: "source") }
end
end
end