node.js - Setting User-Agent correctly for a command line app? -


i built nodejs command line utility make posting gists command line both easy , secure. works enough, wondering right way set user-agent such thing is.

right set arbitrary string: "nodejs/0.0.1 (node) gist command line tool v0.0.1".

are there guidelines on setting user agent? there reason set correctly? there negative consequences setting incorrectly? i'm doing making few http requests.

i think guidelines in rfc 2068 (14.42) (and rfc 1945 same)

as rfc 2068, user-agent should

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 "(" , ")"> 

in opinion, if set user-agents correctly, existing web server or web application parse user-agent correctrly logging, etc.


Comments