mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-27 14:05:19 +01:00
WebFinger: Sends a 400 when resource param is missing, fix XRD typo in test
This commit is contained in:
parent
5af91020f8
commit
cddab5700b
@ -35,4 +35,8 @@ defmodule Pleroma.Web.WebFinger.WebFingerController do
|
|||||||
send_resp(conn, 404, "Unsupported format")
|
send_resp(conn, 404, "Unsupported format")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def webfinger(conn, _params) do
|
||||||
|
send_resp(conn, 400, "Bad Request")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,9 +29,18 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
|
|||||||
|
|
||||||
response =
|
response =
|
||||||
build_conn()
|
build_conn()
|
||||||
|> put_req_header("accept", "application/jrd+json")
|
|> put_req_header("accept", "application/xrd+xml")
|
||||||
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
|
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
|
||||||
|
|
||||||
assert response(response, 200)
|
assert response(response, 200)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "Sends a 400 when resource param is missing" do
|
||||||
|
response =
|
||||||
|
build_conn()
|
||||||
|
|> put_req_header("accept", "application/xrd+xml,application/jrd+json")
|
||||||
|
|> get("/.well-known/webfinger")
|
||||||
|
|
||||||
|
assert response(response, 400)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user