danwrong / restler

REST client library for node.js
MIT License
1.99k stars 390 forks source link

Default User-Agent doesn't conform to RFC #214

Open Capstan opened 9 years ago

Capstan commented 9 years ago

The default User-Agent, Restler for node.js, doesn't conform to the format of the User-Agent in RFC 7231. Instead of asserting a single product, it asserts three products in descending order of priority: Restler, for, and node.js.

Preferably, it would simply be restler or if not sufficiently unambiguous, restler (node.js). Even better if it had the release number, e.g., restler/3.1.0.

I'm not super familiar with node.js, but if the client can prepend their own application so the summary User-Agent string might be something like my-awesome-restler-based-service/0.1a restler/3.1.0, a service owner can make more informed decisions about handling improperly behaved clients. (e.g., nicer to blacklist the bad service that uses the restler client than all users of the client)

easternbloc commented 9 years ago

Thanks @Capstan will take a look at implementing this it shouldn't be much work