From d897385ebb0ec913c464347ea8bc0331e8019bc6 Mon Sep 17 00:00:00 2001 From: Nokome Bentley Date: Wed, 25 Nov 2020 11:13:25 +1300 Subject: [PATCH] fix(HTTP): Add contact information to user agent header --- src/util/http.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/http.ts b/src/util/http.ts index 0e1470850..0b91835b0 100644 --- a/src/util/http.ts +++ b/src/util/http.ts @@ -18,8 +18,10 @@ const pipeline = util.promisify(stream.pipeline) const log = getLogger('encoda:util:http') /** - * A `got` instance with default options for - * HTTP requests. + * A `got` instance with default options for HTTP requests. + * + * User agent is set, and includes a `mailto`, for politeness: + * https://github.com/CrossRef/rest-api-doc#good-manners--more-reliable-service */ const http = got.extend({ cache, @@ -27,7 +29,8 @@ const http = got.extend({ limit: 5, }, headers: { - 'user-agent': `Encoda (https://github.com/stencila/encoda)`, + 'user-agent': + 'Encoda (https://github.com/stencila/encoda; mailto:hello@stenci.la)', 'accept-encoding': 'gzip, deflate', }, })