Download lib/plausible_web/plugs/internal_stats_api_version.ex from Leon4gr45/analytics: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/lib/plausible_web/plugs/internal_stats_api_version.ex
- Command line
-
hf download hf://spaces/Leon4gr45/analytics/lib/plausible_web/plugs/internal_stats_api_version.ex
-
curl -L -o internal_stats_api_version.ex https://huggingface.co/spaces/Leon4gr45/analytics/resolve/main/lib/plausible_web/plugs/internal_stats_api_version.ex
503 Bytes
| defmodule PlausibleWeb.Plugs.InternalStatsApiVersion do | |
| @moduledoc """ | |
| Adds the `x-api-version` response header to all internal | |
| stats API responses. See `Plausible.InternalStatsApiVersion` | |
| for version tracking and rollout logic. | |
| """ | |
| @behaviour Plug | |
| import Plug.Conn | |
| @impl true | |
| def init(opts), do: opts | |
| @impl true | |
| def call(conn, _opts) do | |
| version = Plausible.InternalStatsApiVersion.effective_version() | |
| put_resp_header(conn, "x-api-version", to_string(version)) | |
| end | |
| end | |