no slash on host root for search

This commit is contained in:
Kyle Drake 2025-01-16 14:20:33 -06:00
parent f3a2116b6e
commit 514836fd4f

View file

@ -155,7 +155,7 @@ get '/browse/search' do
@resp['items'].each do |item|
link = Addressable::URI.parse(item['link'])
unencoded_path = Rack::Utils.unescape(Rack::Utils.unescape(link.path)) # Yes, it needs to be decoded twice
item['unencoded_link'] = link.host+unencoded_path
item['unencoded_link'] = unencoded_path == '/' ? link.host : link.host+unencoded_path
item['link'] = link
next if link.host == 'neocities.org'