From c01fdb6e1c1f5730efcd765bc7e61c6de8f22ae8 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 15 May 2015 06:03:45 +0200 Subject: [PATCH] fix the url for the public-posts json closes #5958 --- Changelog.md | 1 + lib/diaspora/fetcher/public.rb | 2 +- spec/lib/diaspora/fetcher/public_spec.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 98cc06be1..785e3aa08 100644 --- a/Changelog.md +++ b/Changelog.md @@ -26,6 +26,7 @@ * ContactPresenter#full_hash_with_person did not contain relationship information [#5936](https://github.com/diaspora/diaspora/pull/5936) * Fix inactive user removal not respecting configuration for daily limits [#5953](https://github.com/diaspora/diaspora/pull/5953) * Fix missing localization of inactive user removal warning emails [#5950](https://github.com/diaspora/diaspora/issues/5950) +* Fix fetching for public post while Webfingering [#5958](https://github.com/diaspora/diaspora/pull/5958) ## Features * Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843) diff --git a/lib/diaspora/fetcher/public.rb b/lib/diaspora/fetcher/public.rb index 241928246..82bda6be4 100644 --- a/lib/diaspora/fetcher/public.rb +++ b/lib/diaspora/fetcher/public.rb @@ -75,7 +75,7 @@ module Diaspora; module Fetcher; class Public FEDERATION_LOGGER.info "fetching public posts for #{@person.diaspora_handle}" - resp = Faraday.get("#{@person.url}people/#{@person.guid}") do |req| + resp = Faraday.get("#{@person.url}people/#{@person.guid}/stream") do |req| req.headers['Accept'] = 'application/json' req.headers['User-Agent'] = 'diaspora-fetcher' end diff --git a/spec/lib/diaspora/fetcher/public_spec.rb b/spec/lib/diaspora/fetcher/public_spec.rb index 28726b2e4..f918d3fc5 100644 --- a/spec/lib/diaspora/fetcher/public_spec.rb +++ b/spec/lib/diaspora/fetcher/public_spec.rb @@ -17,7 +17,7 @@ describe Diaspora::Fetcher::Public do :url => "https://remote-testpod.net", :diaspora_handle => "testuser@remote-testpod.net"}) - stub_request(:get, /remote-testpod.net\/people\/.*/) + stub_request(:get, /remote-testpod.net\/people\/.*\/stream/) .with(headers: { 'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',