Skip to content

Commit 67d7234

Browse files
authored
chore: Rename server header to electric-server (#2458)
In certain environments, e.g. when running in a cloudflare tunnel, the `server` header that we set to `"ElectricSQL/#{version}"` gets overwritten by cloudflare with the value `"cloudflare"`. This PR renames the response header to `electric-version` to avoid this and improve visibility.
1 parent 7496f9a commit 67d7234

File tree

1 file changed

+1
-1
lines changed
  • packages/sync-service/lib/electric/plug

1 file changed

+1
-1
lines changed

packages/sync-service/lib/electric/plug/router.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule Electric.Plug.Router do
4545
match _, do: send_resp(conn, 404, "Not found")
4646

4747
def server_header(conn, version),
48-
do: conn |> Plug.Conn.put_resp_header("server", "ElectricSQL/#{version}")
48+
do: conn |> Plug.Conn.put_resp_header("electric-server", "ElectricSQL/#{version}")
4949

5050
def put_cors_headers(%Plug.Conn{path_info: ["v1", "shape" | _]} = conn, _opts),
5151
do: CORSHeaderPlug.call(conn, %{methods: ["GET", "HEAD", "DELETE", "OPTIONS"]})

0 commit comments

Comments
 (0)