Merge pull request #8378 from SuperTux88/add-dummy-host-meta
Add dummy host meta
This commit is contained in:
commit
2af2bd80f7
8 changed files with 11 additions and 13 deletions
|
|
@ -20,4 +20,14 @@ class NodeInfoController < ApplicationController
|
||||||
format.all { @statistics = NodeInfoPresenter.new("1.0") }
|
format.all { @statistics = NodeInfoPresenter.new("1.0") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: this is only a dummy endpoint, because old versions of the ConnectionTester (<= 0.7.17.0)
|
||||||
|
# checked for this endpoint. Remove this endpoint again once most pods are updated to >= 0.7.18.0
|
||||||
|
def host_meta
|
||||||
|
render xml: <<~XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
||||||
|
</XRD>
|
||||||
|
XML
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
||||||
allow do
|
allow do
|
||||||
origins "*"
|
origins "*"
|
||||||
resource "/api/*", methods: :any
|
resource "/api/*", methods: :any
|
||||||
resource "/.well-known/host-meta"
|
|
||||||
resource "/.well-known/webfinger"
|
resource "/.well-known/webfinger"
|
||||||
resource "/.well-known/openid-configuration"
|
resource "/.well-known/openid-configuration"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ Rails.application.routes.draw do
|
||||||
get ".well-known/nodeinfo", to: "node_info#jrd"
|
get ".well-known/nodeinfo", to: "node_info#jrd"
|
||||||
get "nodeinfo/:version", to: "node_info#document", as: "node_info", constraints: {version: /\d+\.\d+/}
|
get "nodeinfo/:version", to: "node_info#document", as: "node_info", constraints: {version: /\d+\.\d+/}
|
||||||
get "statistics", to: "node_info#statistics"
|
get "statistics", to: "node_info#statistics"
|
||||||
|
get ".well-known/host-meta", to: "node_info#host_meta"
|
||||||
|
|
||||||
# Terms
|
# Terms
|
||||||
if AppConfig.settings.terms.enable? || Rails.env.test?
|
if AppConfig.settings.terms.enable? || Rails.env.test?
|
||||||
|
|
|
||||||
|
|
@ -438,8 +438,6 @@ describe MigrationService do
|
||||||
expect(DiasporaFederation::Discovery::Discovery).to receive(:new).with(archive_author).and_call_original
|
expect(DiasporaFederation::Discovery::Discovery).to receive(:new).with(archive_author).and_call_original
|
||||||
stub_request(:get, "https://#{old_pod_hostname}/.well-known/webfinger?resource=acct:#{archive_author}")
|
stub_request(:get, "https://#{old_pod_hostname}/.well-known/webfinger?resource=acct:#{archive_author}")
|
||||||
.to_return(status: 404)
|
.to_return(status: 404)
|
||||||
stub_request(:get, %r{https*://#{old_pod_hostname}/\.well-known/host-meta})
|
|
||||||
.to_return(status: 404)
|
|
||||||
|
|
||||||
expect_relayable_parent_fetch(archive_author, existing_subscription_guid)
|
expect_relayable_parent_fetch(archive_author, existing_subscription_guid)
|
||||||
.and_raise(DiasporaFederation::Federation::Fetcher::NotFetchable)
|
.and_raise(DiasporaFederation::Federation::Fetcher::NotFetchable)
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,6 @@ describe ArchiveImporter::PostImporter do
|
||||||
:get,
|
:get,
|
||||||
%r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere}
|
%r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere}
|
||||||
).to_return(status: 404, body: "", headers: {})
|
).to_return(status: 404, body: "", headers: {})
|
||||||
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/host-meta})
|
|
||||||
.to_return(status: 404, body: "", headers: {})
|
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
instance.import
|
instance.import
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,6 @@ describe ArchiveImporter do
|
||||||
before do
|
before do
|
||||||
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere})
|
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere})
|
||||||
.to_return(status: 404, body: "", headers: {})
|
.to_return(status: 404, body: "", headers: {})
|
||||||
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/host-meta})
|
|
||||||
.to_return(status: 404, body: "", headers: {})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "doesn't fail" do
|
it "doesn't fail" do
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ describe ArchiveValidator::AuthorPrivateKeyValidator do
|
||||||
before do
|
before do
|
||||||
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere})
|
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/webfinger\?resource=acct:old_id@old_pod\.nowhere})
|
||||||
.to_return(status: 404, body: "", headers: {})
|
.to_return(status: 404, body: "", headers: {})
|
||||||
stub_request(:get, %r{https*://old_pod\.nowhere/\.well-known/host-meta})
|
|
||||||
.to_return(status: 404, body: "", headers: {})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
include_examples "validation result is valid"
|
include_examples "validation result is valid"
|
||||||
|
|
|
||||||
|
|
@ -108,10 +108,6 @@ RSpec.configure do |config|
|
||||||
:get,
|
:get,
|
||||||
"https://example.com/.well-known/webfinger?resource=acct:bob@example.com"
|
"https://example.com/.well-known/webfinger?resource=acct:bob@example.com"
|
||||||
)
|
)
|
||||||
stub_request(
|
|
||||||
:get,
|
|
||||||
"https://example.com/.well-known/host-meta"
|
|
||||||
)
|
|
||||||
$process_queue = false
|
$process_queue = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue