[IQDB] Fix error in previous commit

Somehow these got lost along the way
This commit is contained in:
Earlopain 2023-04-18 19:00:14 +02:00
parent 95aa247ed6
commit edae5a6b77
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897

View File

@ -29,9 +29,9 @@ class IqdbQueriesController < ApplicationController
@matches = IqdbProxy.query_file(params[:file].tempfile)
elsif params[:url].present?
parsed_url = Addressable::URI.heuristic_parse(params[:url]) rescue nil
raise User::PrivilegeError "Invalid URL" unless parsed_url
raise User::PrivilegeError, "Invalid URL" unless parsed_url
whitelist_result = UploadWhitelist.is_whitelisted?(parsed_url)
raise User::PrivilegeError "Not allowed to request content from this URL" unless whitelist_result[0]
raise User::PrivilegeError, "Not allowed to request content from this URL" unless whitelist_result[0]
@matches = IqdbProxy.query(params[:url])
elsif params[:post_id]
@matches = IqdbProxy.query_path(Post.find(params[:post_id]).preview_file_path)