Previously the search form on the /iqdb_queries page submitted directly to the iqdb service (karasuma.donmai.us), which redirected back to Danbooru with the search results. This was different than API requests, which submitted to /iqdb_queries.json which proxied the call to iqdb through Danbooru. Because of this, searches on the /iqdb_queries page had different behavior than API requests. Things like filesize limits and referrer spoofing were handled differently. Now searches on the /iqdb_queries page submit directly to Danbooru. This is simpler and it means that API requests and HTML requests have the same behavior.
14 lines
386 B
Ruby
14 lines
386 B
Ruby
class IqdbQueriesController < ApplicationController
|
|
respond_to :html, :json, :xml, :js
|
|
|
|
def show
|
|
# XXX allow bare search params for backwards compatibility.
|
|
search_params.merge!(params.slice(:url, :post_id, :limit, :similarity).permit!)
|
|
|
|
@matches = IqdbProxy.search(search_params)
|
|
respond_with(@matches, template: "iqdb_queries/show")
|
|
end
|
|
|
|
alias create show
|
|
end
|