source: imaps-frontend/node_modules/clean-css/lib/options/inline-request.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 476 bytes
Line 
1var url = require('url');
2
3var override = require('../utils/override');
4
5function inlineRequestFrom(option) {
6 return override(
7 /* jshint camelcase: false */
8 proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy),
9 option || {}
10 );
11}
12
13function proxyOptionsFrom(httpProxy) {
14 return httpProxy
15 ? {
16 hostname: url.parse(httpProxy).hostname,
17 port: parseInt(url.parse(httpProxy).port)
18 }
19 : {};
20}
21
22module.exports = inlineRequestFrom;
Note: See TracBrowser for help on using the repository browser.