Skip to content

Commit

Permalink
FIX: allowlisted_generic_onebox engine should be last
Browse files Browse the repository at this point in the history
  • Loading branch information
lis2 committed Jul 7, 2020
1 parent 86dab41 commit bdc688c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/onebox/matcher.rb
Expand Up @@ -16,7 +16,10 @@ def oneboxed
uri = URI(@url)
return unless uri.port.nil? || Onebox.options.allowed_ports.include?(uri.port)
return unless uri.scheme.nil? || Onebox.options.allowed_schemes.include?(uri.scheme)
ordered_engines.find { |engine| engine === uri }
ordered_engines
.select { |engine| engine === uri }
.sort_by { |engine| engine.to_s }
.last
rescue URI::InvalidURIError
nil
end
Expand Down

0 comments on commit bdc688c

Please sign in to comment.