Set CORS headers for all .well-known responses
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
So we don't have to consider it for reverse proxies etc.
This commit is contained in:
@@ -94,6 +94,12 @@ RSpec.describe "WebFinger", type: :request do
|
||||
oauth_url = rs_link["properties"]["http://tools.ietf.org/html/rfc6749#section-4.2"]
|
||||
expect(oauth_url).to eql("http://www.example.com/rs/oauth/tony")
|
||||
end
|
||||
|
||||
it "returns CORS headers" do
|
||||
get "/.well-known/nostr.json?name=bobdylan"
|
||||
expect(response.headers['Access-Control-Allow-Origin']).to eq("*")
|
||||
expect(response.headers['Access-Control-Allow-Methods']).to eq('GET')
|
||||
end
|
||||
end
|
||||
|
||||
context "remoteStorage not enabled for user" do
|
||||
|
||||
@@ -46,6 +46,12 @@ RSpec.describe "Well-known URLs", type: :request do
|
||||
expect(res["names"]["bobdylan"]).to eq(user.nostr_pubkey)
|
||||
end
|
||||
|
||||
it "returns CORS headers" do
|
||||
get "/.well-known/nostr.json?name=bobdylan"
|
||||
expect(response.headers['Access-Control-Allow-Origin']).to eq("*")
|
||||
expect(response.headers['Access-Control-Allow-Methods']).to eq('GET')
|
||||
end
|
||||
|
||||
context "without relay configured" do
|
||||
before do
|
||||
Setting.nostr_relay_url = ""
|
||||
|
||||
Reference in New Issue
Block a user