Skip to content

Commit

Permalink
fix(HTTP): Add contact information to user agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Dec 3, 2020
1 parent a295205 commit d897385
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/util/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ 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,
retry: {
limit: 5,
},
headers: {
'user-agent': `Encoda (https://github.com/stencila/encoda)`,
'user-agent':
'Encoda (https://github.com/stencila/encoda; mailto:[email protected])',
'accept-encoding': 'gzip, deflate',
},
})
Expand Down

0 comments on commit d897385

Please sign in to comment.