Initial commit
[yaffs-website] / node_modules / node-sass / scripts / util / downloadoptions.js
1 var proxy = require('./proxy'),
2   userAgent = require('./useragent');
3
4 /**
5  * The options passed to request when downloading the bibary
6  *
7  * There some nuance to how request handles options. Specifically
8  * we've been caught by their usage of `hasOwnProperty` rather than
9  * falsey checks. By moving the options generation into a util helper
10  * we can test for regressions.
11  *
12  * @return {Object} an options object for request
13  * @api private
14  */
15 module.exports = function() {
16   var options = {
17     rejectUnauthorized: false,
18     timeout: 60000,
19     headers: {
20       'User-Agent': userAgent(),
21     }
22   };
23
24   var proxyConfig = proxy();
25   if (proxyConfig) {
26     options.proxy = proxyConfig;
27   }
28
29   return options;
30 };