I built a nodejs command line utility to make posting gists from the command line both easy and secure. It works well enough, but I was wondering what the right way to set the User-Agent for such a thing is.
Right now it is set to a basically arbitrary string: "nodejs/0.0.1 (node) gist command line tool v0.0.1".
Are there guidelines on setting a user agent? Is there any reason to set it correctly? Are there any negative consequences to setting it incorrectly? All I'm doing is making a few http requests.
I think guidelines is in RFC 2068 (14.42) (and RFC 1945 is almost same)
As RFC 2068, user-agent SHOULD like this
User-Agent = "User-Agent" ":" 1*( product | comment )
and
product = token ["/" product-version]
token = 1*<any CHAR except CTLs or tspecials>
product-version = token
comment = "(" *( ctext | comment ) ")"
ctext = <any TEXT excluding "(" and ")">
in my opinion, if you set user-agents correctly, existing web server or web application could parse your user-agent correctrly for logging, etc.