Skip to content

Commit f846b48

Browse files
committed
fix(ipv6-zones-go-url): oh god it's RFC compliant
Signed-off-by: Xe Iaso <me@xeiaso.net>
1 parent 2b0a3e8 commit f846b48

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lume/src/notes/2026/ipv6-zones-go-url.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,22 @@ Yields:
8787
fe80::4%eth0
8888
```
8989

90-
In theory, there is guidance for how to properly handle IPv6 zones in user interfaces in [RFC 9884](https://www.rfc-editor.org/rfc/rfc9844.txt), but there's no such guidance for URLs. Go also does not seem to follow this RFC in [net/url](https://pkg.go.dev).
90+
In theory, there is guidance for how to properly handle IPv6 zones in user interfaces in [RFC 9884](https://www.rfc-editor.org/rfc/rfc9844.txt)~~, but there's no such guidance for URLs~~. Go also does not seem to follow this RFC in [net/url](https://pkg.go.dev).
91+
92+
<Conv name="Cadey" mood="coffee">
93+
EDIT: It seems that this behaviour is compliant with [RFC 6874](https://www.rfc-editor.org/rfc/rfc6874.html) and that this is in fact how it is meant to be done.
94+
95+
```text
96+
IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]"
97+
98+
ZoneID = 1*( unreserved / pct-encoded )
99+
100+
IPv6addrz = IPv6address "%25" ZoneID
101+
```
102+
103+
Our industry confounds me.
104+
105+
</Conv>
91106

92107
So in the meantime in order for Anubis to point to IPv6 zoned addresses, you need to encode the `%` with percent encoding. This is horrible, but it seems that this is an edge case that applies to other frameworks, programming languages, and libraries:
93108

0 commit comments

Comments
 (0)