Skip to content

Commit df311ea

Browse files
committed
Show server header
1 parent 4572cde commit df311ea

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/components_guide_web/live/latency_comparison.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ defmodule ComponentsGuideWeb.LatencyComparisonLive do
3636

3737
def get_headers_of_interest(%Fetch.Response{} = response) do
3838
h = response.headers
39+
location = Enum.find(h, fn {key, _} -> String.downcase(key) == "location" end)
3940
content_length = Enum.find(h, fn {key, _} -> String.downcase(key) == "content-length" end)
4041
content_encoding = Enum.find(h, fn {key, _} -> String.downcase(key) == "content_encoding" end)
4142
transfer_encoding = Enum.find(h, fn {key, _} -> String.downcase(key) == "transfer-encoding" end)
4243
cache_control = Enum.find(h, fn {key, _} -> String.downcase(key) == "cache-control" end)
43-
location = Enum.find(h, fn {key, _} -> String.downcase(key) == "location" end)
44+
server = Enum.find(h, fn {key, _} -> String.downcase(key) == "server" end)
45+
cf_ray = Enum.find(h, fn {key, _} -> String.downcase(key) == "cf-ray" end)
4446
inspect([
47+
location,
4548
content_length,
4649
content_encoding,
4750
transfer_encoding,
4851
cache_control,
49-
location
52+
server,
53+
cf_ray
5054
] |> Enum.filter(fn v -> v != nil end))
5155
end
5256
end
@@ -59,6 +63,7 @@ defmodule ComponentsGuideWeb.LatencyComparisonLive do
5963
<li><.link href="/latency-comparison/cdns">CDNs</.link></li>
6064
<li><.link href="/latency-comparison/dev-blogs">Dev Blogs</.link></li>
6165
<li><.link href="/latency-comparison/robots.txt">Robots.txt</.link></li>
66+
<li><.link href="/latency-comparison/edge">Edge</.link></li>
6267
</ul>
6368
</nav>
6469
<.form

0 commit comments

Comments
 (0)