|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
476 bytes
|
| Line | |
|---|
| 1 | var url = require('url');
|
|---|
| 2 |
|
|---|
| 3 | var override = require('../utils/override');
|
|---|
| 4 |
|
|---|
| 5 | function inlineRequestFrom(option) {
|
|---|
| 6 | return override(
|
|---|
| 7 | /* jshint camelcase: false */
|
|---|
| 8 | proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy),
|
|---|
| 9 | option || {}
|
|---|
| 10 | );
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | function proxyOptionsFrom(httpProxy) {
|
|---|
| 14 | return httpProxy
|
|---|
| 15 | ? {
|
|---|
| 16 | hostname: url.parse(httpProxy).hostname,
|
|---|
| 17 | port: parseInt(url.parse(httpProxy).port)
|
|---|
| 18 | }
|
|---|
| 19 | : {};
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | module.exports = inlineRequestFrom;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.