mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-14 20:04:49 +08:00
fa4addcb50
Closes #2537 RFCs: * http://tools.ietf.org/html/rfc6265#section-4.1.1 * http://tools.ietf.org/html/rfc2616#section-2.2
24 lines
722 B
Elixir
24 lines
722 B
Elixir
defmodule LivebookWeb.EndpointTest do
|
|
use LivebookWeb.ConnCase, async: true
|
|
|
|
test "delete cookies once they go over a certain limit", %{conn: conn} do
|
|
cookies =
|
|
Enum.map(1..5, &"c#{&1}=#{String.duplicate("a", 4096)}") ++
|
|
Enum.map(1..5, &"lb_#{&1}=#{String.duplicate("a", 4096)}")
|
|
|
|
assert [
|
|
"c1=;" <> _,
|
|
"c2=;" <> _,
|
|
"c3=;" <> _,
|
|
"c4=;" <> _,
|
|
"c5=;" <> _,
|
|
"lb_session" <> _,
|
|
"lb_user_data" <> _
|
|
] =
|
|
conn
|
|
|> put_req_header("cookie", Enum.join(cookies, "; "))
|
|
|> get(~p"/")
|
|
|> get_resp_header("set-cookie")
|
|
|> Enum.sort()
|
|
end
|
|
end
|