diff --git a/blog/300-link-addendum.html b/blog/300-link-addendum.html new file mode 100644 index 0000000..02fa7b8 --- /dev/null +++ b/blog/300-link-addendum.html @@ -0,0 +1,53 @@ + + + + + + 300 Addendum + + + + +

300 Addendum

+

Still not the movie. Still a nerd.

+
+

So let's figure out how to add the Link header + for 300 Multiple Choices. As a reminder, here's + the spec:

+
+

It is possible to communicate the list using a set of Link + header fields RFC5988, + each with a relationship of "alternate", though deployment is a + chicken-and-egg problem.

+
+

So based off some examples for the Link header + in general on Mozilla's + docs, and for 300 Link headers specifically on http.dev, this is how you + make the Link headers for a 300:

+
Link: </relative/link/like/this>; rel="alternate"
+Link: <https://site-one.net/blah/blah/blah>; rel="alternate"
+

Unfortunately, there doesn't seem to be an option for + specifying a preferred choice in the Link header. + So I'll just set mine to these:

+
Link: <https://git.askiiart.net/askiiart/askiiart-net>; rel="alternate"
+Link: <https://github.com/askiiart/askiiart.github.io>; rel="alternate"
+

And so here's the new nginx config:

+
    location  /.git {
+        add_header Location "https://git.askiiart.net/askiiart/askiiart-net";
+        add_header Link '<https://git.askiiart.net/askiiart/askiiart-net>; rel="alternate"; "';
+        add_header Link '<https://github.com/askiiart/askiiart.github.io>; rel="alternate"; "';
+        return 300 '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body><a href="https://git.askiiart.net/askiiart/askiiart-net">Self-hosted</a><br><a href="https://github.com/askiiart/askiiart-net">GitHub</a></body></html>';
+    }
+

Main post

+ + + + diff --git a/blog/300-link-addendum.md b/blog/300-link-addendum.md new file mode 100644 index 0000000..f29f231 --- /dev/null +++ b/blog/300-link-addendum.md @@ -0,0 +1,36 @@ +# 300 Addendum + +Still not the movie. Still a nerd. + +--- + +So let's figure out how to add the `Link` header for 300 Multiple Choices. As a reminder, [here's the spec](https://httpwg.org/specs/rfc9110.html#status.300): + +> It is possible to communicate the list using a set of Link header fields *[RFC5988](https://httpwg.org/specs/rfc9110.html#RFC8288)*, each with a relationship of "alternate", though deployment is a chicken-and-egg problem. + +So based off some examples for the `Link` header in general on [Mozilla's docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link), and for 300 `Link` headers specifically [on http.dev](https://http.dev/300), this is how you make the `Link` headers for a 300: + +```txt +Link: ; rel="alternate" +Link: ; rel="alternate" +``` + +Unfortunately, there doesn't seem to be an option for specifying a preferred choice in the `Link` header. So I'll just set mine to these: + +```txt +Link: ; rel="alternate" +Link: ; rel="alternate" +``` + +And so here's the new nginx config: + +```language-nginx + location /.git { + add_header Location "https://git.askiiart.net/askiiart/askiiart-net"; + add_header Link '; rel="alternate"; "'; + add_header Link '; rel="alternate"; "'; + return 300 'Self-hosted
GitHub'; + } +``` + +[Main post](/blog/300.html) diff --git a/blog/300.html b/blog/300.html index 8c70894..646c482 100644 --- a/blog/300.html +++ b/blog/300.html @@ -114,14 +114,16 @@ 9110, again:

It is possible to communicate the list using a set of Link - header fields RFC5988, + header fields RFC5988, each with a relationship of "alternate", though deployment is a chicken-and-egg problem.

-

I'll probably figure out the Link header some - other time and will add this later, at which point I'll post an - addendum. Until then, bye I guess!

+

I'll probably figure out the Link header + some other time and will add this later, at which point I'll + post an addendum. Until then, bye I guess!

+

Update: Link addendum here!

Footnotes and stuff

browser-specific info

Elsewhere in the Quora thread it says, in short, that Firefox diff --git a/blog/300.md b/blog/300.md index f669750..e31d45a 100644 --- a/blog/300.md +++ b/blog/300.md @@ -84,9 +84,11 @@ These still don't work, they just return my reverse proxy container's gateway's Turns out might be a standard way to do it! From [RFC 9110](https://httpwg.org/specs/rfc9110.html#status.300), again: -> It is possible to communicate the list using a set of Link header fields [RFC5988](https://httpwg.org/specs/rfc9110.html#RFC8288), each with a relationship of "alternate", though deployment is a chicken-and-egg problem. +> It is possible to communicate the list using a set of Link header fields *[RFC5988](https://httpwg.org/specs/rfc9110.html#RFC8288)*, each with a relationship of "alternate", though deployment is a chicken-and-egg problem. -I'll probably figure out the `Link` header some other time and will add this later, at which point I'll post an addendum. Until then, bye I guess! +~~I'll probably figure out the `Link` header some other time and will add this later, at which point I'll post an addendum. Until then, bye I guess!~~ + +Update: `Link` addendum [here](/blog/300-link-addendum.html)! ## Footnotes and stuff diff --git a/blog/feed.xml b/blog/feed.xml index db21c52..363d2e9 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -5,7 +5,7 @@ askiiart.net blog The feed for askiiart.net but just the blog, I guess https://askiiart.net/blog/ - Wed, 06 Dec 2023 17:42:13 +0000 + Wed, 06 Dec 2023 18:45:52 +0000 Marlin Boot Animations https://askiiart.net/til/marlin-boot-animations.html @@ -14,6 +14,10 @@ 300 https://askiiart.net/til/300.html + + 300 Addendum + https://askiiart.net/til/300-link-addendum.html + \ No newline at end of file diff --git a/default.conf b/default.conf index 2fc2914..bc88fc1 100755 --- a/default.conf +++ b/default.conf @@ -114,8 +114,9 @@ server { location /.git { # There is no standard way to present options, but in the rare cases that 300 is used it just has a list of links. The Location header is for preferred thing. - default_type "text/html"; add_header Location "https://git.askiiart.net/askiiart/askiiart-net"; + add_header Link '; rel="alternate"; "'; + add_header Link '; rel="alternate"; "'; return 300 'Self-hosted
GitHub'; } diff --git a/feed.xml b/feed.xml index 368bd29..8387070 100644 --- a/feed.xml +++ b/feed.xml @@ -5,7 +5,7 @@ askiiart.net The feed for askiiart.net, I guess https://askiiart.net - Wed, 06 Dec 2023 17:42:13 +0000 + Wed, 06 Dec 2023 18:45:52 +0000 Marlin Boot Animations https://askiiart.net/blog/marlin-boot-animations.html @@ -14,6 +14,10 @@ 300 https://askiiart.net/blog/300.html + + 300 Addendum + https://askiiart.net/blog/300-link-addendum.html + Akkoma in Docker https://askiiart.net/til/akkoma-in-docker.html diff --git a/til/feed.xml b/til/feed.xml index 528ecdd..04363fa 100644 --- a/til/feed.xml +++ b/til/feed.xml @@ -5,7 +5,7 @@ askiiart.net TIL The feed for askiiart.net but just TIL, I guess https://askiiart.net/til/ - Wed, 06 Dec 2023 17:42:13 +0000 + Wed, 06 Dec 2023 18:45:52 +0000 Akkoma in Docker https://askiiart.net/til/akkoma-in-docker.html