From: "Bjørn Mork" <bmork@dod.no>
Subject: Re: Using versions instead of XEmacs codenames in User-Agent
Date: Mon, 10 Jan 2005 11:39:46 +0100 [thread overview]
Message-ID: <87sm59zhxp.fsf@obelix.mork.no> (raw)
In-Reply-To: <microsoft-free.874qhptzc8.fsf@youngs.au.com>
Steve Youngs <steve@youngs.au.com> writes:
> * Bjørn Mork <bmork@dod.no> writes:
> > Steve Youngs <steve@youngs.au.com> writes:
> >>
> >> Yep, however, IMHO, this...
> >>
> >> SXEmacs/22.1.1 (Aston Martin, berkeley-unix)
> >>
> >> doesn't look anywhere near as nice as...
> >>
> >> SXEmacs/22.1.1 "Aston Martin" (berkeley-unix)
>
> > Maybe. But it doesn't really matter since the first version uses a
> > perfectly legal comment while the second is an invalid User-Agent
> > field.
>
> OK, now I'm really confused. Because going by what you quoted about
> tokens and separators, aren't both of them invalid? And if not, why
> not?
Oh, I left that as an exercise :-)
More from RFC 2616:
<quote>
14.43 User-Agent
The User-Agent request-header field contains information about the
user agent originating the request. This is for statistical purposes,
the tracing of protocol violations, and automated recognition of user
agents for the sake of tailoring responses to avoid particular user
agent limitations. User agents SHOULD include this field with
requests. The field can contain multiple product tokens (section 3.8)
and comments identifying the agent and any subproducts which form a
significant part of the user agent. By convention, the product tokens
are listed in order of their significance for identifying the
application.
User-Agent = "User-Agent" ":" 1*( product | comment )
Example:
User-Agent: CERN-LineMode/2.15 libwww/2.17b3
</quote>
and
<quote>
Comments can be included in some HTTP header fields by surrounding
the comment text with parentheses. Comments are only allowed in
fields containing "comment" as part of their field value definition.
In all other fields, parentheses are considered part of the field
value.
comment = "(" *( ctext | quoted-pair | comment ) ")"
ctext = <any TEXT excluding "(" and ")">
</quote>
> Also, what the hell does RFC 2616 - "Hypertext Transfer Protocol --
> HTTP/1.1" have to do with email headers? I honestly don't understand
> that at all?
No, that's not very clear. I assume it's because that's the RFC where
the User-Agent field is currently specified. RFC 2822 gives these
generic rules for optional header fields:
<quote>
3.6.8. Optional fields
Fields may appear in messages that are otherwise unspecified in this
standard. They MUST conform to the syntax of an optional-field.
This is a field name, made up of the printable US-ASCII characters
except SP and colon, followed by a colon, followed by any text which
conforms to unstructured.
The field names of any optional-field MUST NOT be identical to any
field name specified elsewhere in this standard.
optional-field = field-name ":" unstructured CRLF
field-name = 1*ftext
ftext = %d33-57 / ; Any character except
%d59-126 ; controls, SP, and
; ":".
For the purposes of this standard, any optional field is
uninterpreted.
</quote>
which allows any syntax. However, when it comes to mail and Usenet
user agents the current USEFOR draft is probably a better reference
than both RFC 2822 and RFC 2616:
http://www.ietf.org/internet-drafts/draft-ietf-usefor-usefor-02.txt
Luckily, it seems to mostly agree with RFC 2616:
<quote>
3.2.12 User-Agent
The User-Agent header contains information about the user agent
(typically a newsreader) generating the article, for statistical
purposes and tracing of standards violations to specific software
needing correction. It is intended that this header be suitable for
use in Email.
user-agent = "User-Agent:" SP 1*product CRLF
product = [CFWS] token [CFWS] [ "/" product-version ]
product-version = [CFWS] token [CFWS]
This header MAY contain multiple product-tokens identifying the agent
and any subproducts which form a significant part of the posting
agent, listed in order of their significance for identifying the
application.
NOTE: This header supersedes the role performed redundantly by
experimental headers such as X-Newsreader, X-Mailer,
X-Posting-Agent, X-Http-User-Agent, and other headers previously
used on Usenet and in Email for this purpose. Use of these
experimental headers SHOULD be discontinued in favor of the
single, standard User-Agent header.
NOTE: [RFC2616] describes a similar facility for the HTTP
protocol. This specification differs in that "{" and "}" are
allowed in tokens (<product> and <product-version>) and comments
are permitted wherever whitespace is allowed.
</quote>
IMHO, it's best using a syntax that conforms to USEFOR, RFC 2616 and
RFC 2822 unless there are good reasons not to do so. That means
sticking with the RFC 2616 definition even for mail and news user
agents. But that's only an opionion.
Bjørn
--
Ignoramus!
next prev parent reply other threads:[~2005-01-10 10:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-06 1:49 [PATCH] SXEmacs User-Agent string Steve Youngs
2005-01-06 13:41 ` Using versions instead of XEmacs codenames in User-Agent (was: [PATCH] SXEmacs User-Agent string) Reiner Steib
2005-01-06 23:00 ` Using versions instead of XEmacs codenames in User-Agent Katsumi Yamaoka
2005-01-06 23:29 ` Steve Youngs
2005-01-08 18:09 ` Reiner Steib
2005-01-09 1:28 ` Steve Youngs
2005-01-09 20:55 ` Reiner Steib
2005-01-09 23:09 ` Steve Youngs
2005-01-10 8:42 ` Bjørn Mork
2005-01-10 9:20 ` Steve Youngs
2005-01-10 10:39 ` Bjørn Mork [this message]
2005-01-10 15:07 ` Reiner Steib
2005-01-10 23:29 ` Steve Youngs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sm59zhxp.fsf@obelix.mork.no \
--to=bmork@dod.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).