-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(HTTP): Add contact information to user agent header
- Loading branch information
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', | ||
}, | ||
}) | ||
|