From 6d682d6c39e557810a713aed77c884f5e5539669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Tue, 9 Dec 2014 16:21:04 +0100 Subject: [PATCH] Use URI.join to assemble the URL to fetch a single post That normalizes any extra / on the base URL. --- lib/diaspora/fetcher/single.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diaspora/fetcher/single.rb b/lib/diaspora/fetcher/single.rb index 5dfeb7f73..4e8340132 100644 --- a/lib/diaspora/fetcher/single.rb +++ b/lib/diaspora/fetcher/single.rb @@ -30,7 +30,7 @@ module Diaspora # @param [String] guid the remote post's guid # @return [Post] an unsaved remote post or false if the post was not found def fetch_post author, guid - url = author.url + "/p/#{guid}.xml" + url = URI.join(author.url, "/p/#{guid}.xml") response = Faraday.get(url) raise Diaspora::PostNotFetchable if response.status == 404 # Old pod, Friendika, deleted raise "Failed to get #{url}" unless response.success? # Other error, N/A for example