Add CaptureTimezone plug to browser pipeline
This commit is contained in:
parent
d9876d8217
commit
d05c493943
2 changed files with 3 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ defmodule ToweropsWeb.Endpoint do
|
|||
plug Plug.MethodOverride
|
||||
plug Plug.Head
|
||||
plug Plug.Session, @session_options
|
||||
plug ToweropsWeb.Plugs.CaptureTimezone
|
||||
plug ToweropsWeb.Router
|
||||
|
||||
# Disable logging for health check endpoint to reduce log noise from K8s probes
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ defmodule ToweropsWeb.Plugs.CaptureTimezone do
|
|||
|
||||
@doc false
|
||||
def call(conn, _opts) do
|
||||
conn = fetch_session(conn)
|
||||
|
||||
timezone =
|
||||
case get_req_header(conn, "cf-timezone") do
|
||||
[tz] when is_binary(tz) and byte_size(tz) > 0 -> tz
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue