Article View: news.software.nntp
Article #82905Re: Cleanfeed question - HTTP type URLs
From: Matija Nalis
Date: Tue, 09 Mar 2010 19:58
Date: Tue, 09 Mar 2010 19:58
164 lines
9135 bytes
9135 bytes
On Sun, 7 Mar 2010 16:36:22 -0800, D. Stussy <spam+newsgroups@bde-arc.ampr.org> wrote:
> "Matija Nalis" <mnalis-news@voyager.hr> wrote in message
>> My reading of RFC3986 [STD0066] section 3.2.2. is that "host" part of the
>> URI is that that only IPv6 ("and later") address literals are bracketed in
>> "[]", and that IPv4 address literals are not.
>>
>> So http://127.0.0.1/ *is* technically valid, while http://[127.0.0.1]/ is *not*.
>>
>> Or do you have some other insights ?
>
> Yes. When IPv4 addresses take the place of a domain name, they need to be
> bracketed. Such is true for other things such as mailboxes, the HELO
> parameter in SMTP, etc.,....
That is RFC2821 SMTP standard, it has no implication for HTTP URIs we were
talking above ("http://127.0.0.1/" vs. "http://[127.0.0.1]/")
When IPv4 addresses take the place in various protocols used on computers,
they often take other forms. For example:
In RFC1035, IPv4 address must be specified as 4-byte raw values in network
byte order with adequate RDATA TYPE for it.
In RFC3308, IPv4 address must be specified as dotted-quad string value
prefixed with "ip4:" string.
In RFC4545, IPv4 address must be specified as combined entries of
AddressFamilyNumbers and AuthAddress.
and many, many more...
As you see, they way IPv4 address is specified in one protocol, will often
look somewhat (or completely) different in other protocol. The fact that few
of them *might* look somewhat similar, is no particularly good reason to call
for "grand unification" (although it would be nice, the trouble of changing
all that programs would IMHO far outweighs any potential benefit)
> I agree that many implementations accept the unbracketed form, but that
> doesn't mean it's correct.
It means they follow RFC3986, which is (or should be) authoritative in how
URIs should be used. So, I would call such behavior "correct" until such
time an errata for RFC3986 is issued, or RFC3986 is obsoleted or updated by
another URI standard.
> The syntax for RFC 3986 for "IP-literal" is wrong. It should be:
>
> IP-literal = "[" ( IPv4address / IPv6address / IPvFuture ) "]"
If by "wrong" you mean "a typo in RFC3986", I do not think so. It
explicitly says in many ways in section 3.2.2 of RFC3986, both in English
and in BNF. I think that BNF written was exactly what they meant when they
wrote it.
If, however, by "wrong" you mean "I would like it to be different", that may
be (and I might agree), but that does not change the fact that it is *NOT*
the way *current* standards say it should be done (and hence, NOT how most of
the programs implement it).
If you want things to be done that way, you should work with IETF to pass
standard which says so, and then work with implementors to implement it.
Breaking standards because "it looks more aesthetic that way" or "would be
more universal" is IMHO definitely *NOT* a way to go.
> Citations:
> - RFC 3696, Section 3: "The domain name can also be replaced by an IP
> address in square brackets, ..."
> - RFC 2821, Section 4.1.3 (Repeated in 5321, same section): "For IPv4
> addresses, this form uses four small decimal integers separated by dots and
> enclosed by brackets such as ..."
RFC 2821 talks about implementation of SMTP protocol, not HTTP URIs. RFC
3696 in section 3 also talks about e-mail addresses / SMTP (and references
RFC2822 and RFC2821 explicitly).
As I said above, as such they are irrelevant for implementation of HTTP URIs.
> A "mailto:" URI is a subset of all URIs, and as such, they are required to
Yes, it is. More specifically, it is defined by RFC 2368, which in section 2
explicitly specifies "Note that all URL reserved characters in "to" must be
encoded" (and that, according to rfc2396 and it's successor rfc3986 - sec
2.4.3), includes "[" and "]". So if the e-mail address did contain those
characters (as RFC822 IPv4 address literals), they *must* be URL-encoded
before being put in URI.
> have bracketed IP-address literals (from the various SMTP RFCs cited above)
> since they are the textual union of a "mailto:" string with a valid mailbox
> address. Therefore, the general syntax for URIs must accept this form (a
> bracketed IPv4 address), and that's my proof that RFC 3986's syntax
> specification is wrong.
If anything, such reasoning would prove that RFC2821 (PROPOSED STANDARD) and
RFC 3696 (INFORMATIONAL) are wrong. Of those mentioned, only RFC3986 is an
actual *STANDARD* (STD0066) - those two you mention are not (yet), so the
established standard would take precedence over proposed one.
But as I explained above, there is no need for one of the above RFCs to be
wrong, as they all can be correct at the same time (as you must URL-encode
any square brackets present in e-mail address before putting it in mailto:
URI)
> The reference to the required bracketing of IPv6 addresses is because they
> contain colons, which is also the port specification separator, and thus
> bracketing is required to avoid ambiguity. Although there is no such
> ambiguity for IPv4, RFC 3986 itself starts section 3.2.2 ("Host") with:
>
> "The host subcomponent of authority is identified by an IP literal
> encapsulated within square brackets, ..."
But please read that whole section. In explicitly states that for the
purposes of the document it DOES NOT accept "IPv4" as being "IP literal".
I cite: "The host subcomponent of authority is identified by an IP literal
encapsulated within square brackets, an IPv4 address in dotted-decimal form,
or a registered name."
Note the use of "OR", which symbolizes mutually-exclusive options.
Also, even if English can be misinterpreted, the BNF is quite clear and CANNOT
be misinterpreted:
host = IP-literal / IPv4address / reg-name
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
As you can see, IPv4 address simply cannot be IP-literal and hence cannot be
put between square brackets under any circumstances.
So IPv4 is explicitly *not* considered IP literal in context of RTC 3968,
and it explicitly says and shows in BNF on several places that IPv4
address must not be bracketed.
> Although it further states, "an IPv4 address in dotted-decimal form," such
> need not be a list of alternatives. In English diction and style, such
> could be equal to a parenthetical clause which may be expressed using
> parentheses except for stress. However, I grant you that the section
> further lists the following syntax:
>
> host = IP-literal / IPv4address / reg-name
Yes, BNF is there precisely to avoid any ambiguities in English language. It
cannot be misinterpreted, and it is quite clear what is it's intention (even
if you or I might personally prefer it to be different).
> However, we already know that RFC 3986 has introduced syntactical errors
> into the overall URI scheme as such syntax will NOT work for the "mailto"
I do not agree with you on that, as I've explained above.
But if you still think RFC 3986 is in error, you're welcome to approach IETF
and ask them to issue the Errata. Let us know of results if you do.
One another point to consider: even if you are correct and RFC 3986 is in
error and Errata is issued; there are many millions of copies of software
that works quite happily and often depends on "http://127.0.0.1/" syntax to
work (they do, you can try it in your browser, MUA, etc).
Breaking that assumption (without veeery long phase-out period after issuing
"correct" standard) would help *nobody* and would make problems for many
people. Why would one do that, especially if intention is (as the subject
might indicate) to make filter that drops spam and allows legitimate posts
(and not another way around) ?
--
Opinions above are GNU-copylefted.
Technical Details
Message-ID:
<slrnhpda2k.3b7.mnalis-news@eagle102.home.lan>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.CARNet.hr!not-for-mailReferences:
<hmmvaq$kfh$1@snarked.org> <slrnhp82vn.dgn.mnalis-news@eagle102.home.lan> <hn1grt$t4r$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <slrnhpda2k.3b7.mnalis-news@eagle102.home.lan> Subject: Re: Cleanfeed question - HTTP type URLs Date: Tue, 9 Mar 2010 20:58:10 +0100 From: Matija Nalis <mnalis-news@voyager.hr> References: <hmmvaq$kfh$1@snarked.org> <slrnhp82vn.dgn.mnalis-news@eagle102.home.lan> <hn1grt$t4r$1@snarked.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.CARNet.hr!not-for-mail Newsgroups: news.software.nntp Organization: CARNet, Croatia Lines: 164 NNTP-Posting-Host: 193.198.179.113 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news1.carnet.hr 1268164691 4005 193.198.179.113 (9 Mar 2010 19:58:11 GMT) X-Complaints-To: abuse@CARNet.hr NNTP-Posting-Date: Tue, 9 Mar 2010 19:58:11 +0000 (UTC) User-Agent: slrn/pre0.9.9-111 (Linux) Cancel-Lock: sha1:zddSWVSfOR/6KCf+QslohgM8kH0= X-Original-Bytes: 8923