Re: [whatwg/fetch] Define ABNF for `origin-or-null. (PR #1924)

@hm-harshit commented on this pull request.



> +                  / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) h16
+                  / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   h16
+                  / [ *4( h16 ":" ) h16 ] "::"              h16
+                  / [ *5( h16 ":" ) h16 ] "::"
+<dfn export>h16</dfn>               = "0" / ( non-zero-hex 0*3hex )
+<dfn export>non-zero-hex</dfn>      = %x31-39 / %x61-66 ; '1'-'9' or lowercase 'a'-'f'
+<dfn export>hex</dfn>               = %x30-39 / %x61-66 ; '0'-'9' or lowercase 'a'-'f
+
+<dfn export>lower-alpha</dfn>       = %x61-7A
+<dfn export>lower-alphanum</dfn>    = <a>lower-alpha</a> / DIGIT
+<dfn export>domain-label</dfn>      = <a>lower-alphanum</a> / ( <a>lower-alphanum</a> *( <a>lower-alphanum</a> / "-" ) <a>lower-alphanum</a> )
+<dfn export>serialized-domain</dfn> = *( <a>domain-label</a> "." ) <a>domain-label</a>
+
+<dfn export>serialized-scheme</dfn> = <a>lower-alpha</a> *( <a>lower-alphanum</a> / "+" / "-" / "." )
+<dfn export>serialized-host</dfn>   = <a>serialized-ipv4</a> / "[" <a>serialized-ipv6</a> "]" / <a>serialized-domain</a>
+<dfn export>serialized-port</dfn>   = 1*5DIGIT

> The current rule:
> ```abnf
> serialized-port = 1*5DIGIT
> ```
> Could we use something like this here?

> ```abnf
> serialized-port = "0" / ( %x31-39 0*4DIGIT )
> ```
>

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1924#pullrequestreview-4196516105
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1924/review/4196516105@github.com>

Received on Wednesday, 29 April 2026 11:32:56 UTC