Fix request time cookie removing content-type header

This commit is contained in:
Mikko Ahlroth 2018-11-26 22:15:47 +02:00
parent e7ff21ace3
commit 0e2066b712

View file

@ -48,12 +48,7 @@ defmodule Mebe2.Web.Middleware.RequestTime do
old_time = Process.get(@timer_key)
diff = get_time() - old_time
%Raxx.Response{
response
| headers: [
{"set-cookie", "#{@timer_cookie_name}=#{diff}; Max-Age=60"}
]
}
Raxx.set_header(response, "set-cookie", "#{@timer_cookie_name}=#{diff}; Max-Age=60")
end
defp get_time(), do: :erlang.monotonic_time(:micro_seconds)