From 514836fd4f5b3113810c707b932b030fb952175d Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Thu, 16 Jan 2025 14:20:33 -0600 Subject: [PATCH] no slash on host root for search --- app/browse.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/browse.rb b/app/browse.rb index 8487fdc3..c15160a4 100644 --- a/app/browse.rb +++ b/app/browse.rb @@ -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'