Add WebFinger endpoint #118

Merged
raucao merged 2 commits from feature/webfinger into master 2023-04-11 09:44:40 +00:00
2 changed files with 4 additions and 6 deletions
Showing only changes of commit a2100b23a9 - Show all commits

View File

@@ -1,6 +1,5 @@
class WebfingerController < ApplicationController
before_action :allow_cross_origin, :only => [:show]
before_action :allow_cross_origin_requests, only: [:show]
layout false
@@ -51,9 +50,8 @@ class WebfingerController < ApplicationController
}
end
def allow_cross_origin
def allow_cross_origin_requests
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
end
end

View File

@@ -7,7 +7,7 @@ RSpec.describe "WebFinger", type: :request do
create :user, cn: 'tony', ou: 'kosmos.org'
end
context "remoteStorage service enabled" do
context "remoteStorage enabled globally" do
it "includes the remoteStorage link for the user" do
get "/.well-known/webfinger?resource=acct%3Atony%40kosmos.org"
expect(response).to have_http_status(:ok)
@@ -22,7 +22,7 @@ RSpec.describe "WebFinger", type: :request do
end
end
context "remoteStorage service disabled" do
context "remoteStorage not available" do
before do
Setting.remotestorage_enabled = false
end