logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

cache_control_test.exs (658B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.CacheControlTest do
  5. use Pleroma.Web.ConnCase
  6. alias Plug.Conn
  7. test "Verify Cache-Control header on static assets", %{conn: conn} do
  8. conn = get(conn, "/index.html")
  9. assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
  10. end
  11. test "Verify Cache-Control header on the API", %{conn: conn} do
  12. conn = get(conn, "/api/v1/instance")
  13. assert Conn.get_resp_header(conn, "cache-control") == ["max-age=0, private, must-revalidate"]
  14. end
  15. end