Use URI.join to assemble the URL to fetch a single post
That normalizes any extra / on the base URL.
This commit is contained in:
parent
ed0005c44d
commit
6d682d6c39
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue