about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-09-13 16:01:39 +0200
committerGitHub <noreply@github.com>2019-09-13 16:01:39 +0200
commit50edf84898a1c16541400cf60442a54f476d2e12 (patch)
treeb4100c99946b2b1253ed702345e19d2912f51e77 /app/services
parent0762258aec68f1d422a0ecdc29d637c5807f943a (diff)
Fix search API not resolving URL when type is given (#11822)
Fix #11771
Diffstat (limited to 'app/services')
-rw-r--r--app/services/search_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/search_service.rb b/app/services/search_service.rb
index fe601bbf4..a5ba5dd11 100644
--- a/app/services/search_service.rb
+++ b/app/services/search_service.rb
@@ -11,7 +11,7 @@ class SearchService < BaseService
 
     default_results.tap do |results|
       if url_query?
-        results.merge!(url_resource_results) unless url_resource.nil?
+        results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
       elsif @query.present?
         results[:accounts] = perform_accounts_search! if account_searchable?
         results[:statuses] = perform_statuses_search! if full_text_searchable?
@@ -69,7 +69,7 @@ class SearchService < BaseService
   end
 
   def url_query?
-    @resolve && @options[:type].blank? && @query =~ /\Ahttps?:\/\//
+    @resolve && @query =~ /\Ahttps?:\/\//
   end
 
   def url_resource_results