Skip to content

Commit 65d67ba

Browse files
committed
Add http headers page
1 parent 171a8c5 commit 65d67ba

File tree

4 files changed

+92
-2
lines changed

4 files changed

+92
-2
lines changed

apps/components_guide_web/lib/components_guide_web/controllers/web_standards_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule ComponentsGuideWeb.WebStandardsController do
66
render(conn, "index.html", article: "intro")
77
end
88

9-
@articles ["url", "promise", "http-caching", "html"]
9+
@articles ["url", "promise", "http-caching", "html", "http-headers"]
1010

1111
def show(conn, %{"id" => article}) when article in @articles do
1212
render(conn, "index.html", article: article)

apps/components_guide_web/lib/components_guide_web/templates/web_standards/_nav.html.eex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<li><%= link("URL", to: '/web-standards/url') %>
55
<li><%= link("HTML", to: '/web-standards/html') %>
66
<li><%= link("Promise", to: '/web-standards/promise') %>
7+
<li><%= link("HTTP Headers", to: '/web-standards/http-headers') %>
78
<li><%= link("HTTP Caching", to: '/web-standards/http-caching') %>
89
</ul>
910
</nav>

apps/components_guide_web/lib/components_guide_web/templates/web_standards/_top.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="mx-auto max-w-4xl text-white">
22
<h1 y-y x-x=md class="pt-8 row space-x-4 text-4xl text-center font-bold leading-tight text-shadow">
3-
<span class="mr-1 text-5xl">🧶💝</span>
3+
<span class="mr-1 text-5xl">🤝💝</span>
44
<span><%= "Web Standards" %></span>
55
</h1>
66
<%= render ComponentsGuideWeb.WebStandardsView, "_nav.html" %>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# HTTP Headers
2+
3+
<form role="search" class="text-center" id="search-http-headers">
4+
<input name="q" type="search" placeholder="Search HTTP Headers…" autofocus class="text-white bg-gray-800 border-gray-700 rounded">
5+
</form>
6+
7+
<script type="module">
8+
const searchForm = document.getElementById("search-http-headers");
9+
const listItems = searchForm.parentNode.querySelectorAll('ul li');
10+
searchForm.addEventListener('input', () => {
11+
const values = new FormData(searchForm);
12+
const q = values.get('q').trim().toLowerCase();
13+
for (const li of Array.from(listItems)) {
14+
const matches = q === '' ? true : li.textContent.toLowerCase().includes(q);
15+
li.hidden = !matches;
16+
}
17+
});
18+
</script>
19+
20+
## Request
21+
22+
- Host (required)
23+
- User-Agent
24+
- Accept
25+
- Accept-Language
26+
- Accept-Encoding
27+
- Origin
28+
- Referer
29+
- Connection
30+
- Content-Length
31+
- Range
32+
- Cache-Control
33+
- `max-age`
34+
- `max-stale`
35+
- `min-fresh`
36+
- `no-cache`
37+
- `no-store`
38+
- `no-transform`
39+
- `only-if-cached`
40+
- `stale-if-error`
41+
- If-Modified-Since
42+
- If-Unmodified-Since
43+
- If-Match
44+
- If-None-Match
45+
- If-Range
46+
- Authorization
47+
- Expect
48+
- Cookie
49+
50+
## Response
51+
52+
- Content-Length
53+
- Content-Type
54+
- Content-Encoding
55+
- Transfer-Encoding
56+
- Location
57+
- Allow
58+
- Link
59+
- Date
60+
- Accept-Ranges
61+
- Content-Range
62+
- Age
63+
- Expires
64+
- Vary
65+
- ETag
66+
- Cache-Control
67+
- `max-age`
68+
- `s-maxage`
69+
- `no-cache`
70+
- `no-store`
71+
- `no-transform`
72+
- `must-revalidate`
73+
- `proxy-revalidate`
74+
- `must-understand`
75+
- `private`
76+
- `public`
77+
- `immutable`
78+
- `stale-while-revalidate`
79+
- `stale-if-error`
80+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
81+
- https://github.com/mdn/browser-compat-data/blob/main/http/headers/cache-control.json
82+
- Set-Cookie
83+
- Access-Control-Allow-Origin
84+
- Upgrade
85+
- Alt-Svc
86+
- Retry-After
87+
- Server-Timing
88+
- Report-To
89+
- Last-Event-ID

0 commit comments

Comments
 (0)