Merge branch 'frontendstatic-ignore-api-calls' into 'develop'

Filter out API calls from FrontendStatic plug

Closes #2261

See merge request pleroma/pleroma!3346
This commit is contained in:
lain 2021-02-27 19:40:38 +00:00
commit d0823d7f1e
3 changed files with 53 additions and 2 deletions

View file

@ -74,4 +74,35 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do
assert %Plug.Conn{status: :success} = get(conn, url)
end
end
test "api routes are detected correctly" do
# If this test fails we have probably added something
# new that should be in /api/ instead
expected_routes = [
"api",
"main",
"ostatus_subscribe",
"oauth",
"objects",
"activities",
"notice",
"users",
"tags",
"mailer",
"inbox",
"relay",
"internal",
".well-known",
"nodeinfo",
"web",
"auth",
"embed",
"proxy",
"test",
"user_exists",
"check_password"
]
assert expected_routes == Pleroma.Web.get_api_routes()
end
end