Compare 78c8e6c ... +4 ... 3ede394

Coverage Reach
lib/util/index.js lib/util/data-server.js lib/util/http-mgr.js lib/util/file-mgr.js lib/util/transproto.js lib/util/common.js lib/util/whistle-transform.js lib/util/zlib.js lib/util/is-utf8.js lib/util/log-server.js lib/util/replace-pattern-transform.js lib/util/logger.js lib/util/file-writer-transform.js lib/util/patch.js lib/util/speed-transform.js lib/util/replace-string-transform.js lib/util/parse-query.js lib/util/parse-url.js lib/util/buf-util.js lib/util/drain.js lib/rules/rules.js lib/rules/util.js lib/rules/index.js lib/rules/storage.js lib/rules/protocols.js lib/rules/dns.js lib/inspectors/res.js lib/inspectors/req.js lib/inspectors/data.js lib/inspectors/rules.js lib/inspectors/log.js lib/inspectors/weinre.js lib/inspectors/index.js lib/https/index.js lib/https/ca.js lib/https/h2.js lib/plugins/index.js lib/plugins/module-paths.js lib/plugins/get-plugins.js lib/plugins/get-plugins-sync.js lib/plugins/util.js lib/config.js lib/socket-mgr.js lib/tunnel.js lib/handlers/file-proxy.js lib/handlers/plugin-handler.js lib/handlers/http-proxy.js lib/handlers/error-handler.js lib/handlers/index.js lib/handlers/final-handler.js lib/index.js lib/init.js lib/upgrade.js lib/service/index.js biz/webui/cgi-bin/composer.js biz/webui/cgi-bin/util.js biz/webui/cgi-bin/rules/select.js biz/webui/cgi-bin/rules/rename.js biz/webui/cgi-bin/rules/add.js biz/webui/cgi-bin/rules/move-to.js biz/webui/cgi-bin/rules/enable-default.js biz/webui/cgi-bin/rules/unselect.js biz/webui/cgi-bin/rules/allow-multiple-choice.js biz/webui/cgi-bin/rules/remove.js biz/webui/cgi-bin/rules/index.js biz/webui/cgi-bin/rules/list.js biz/webui/cgi-bin/get-data.js biz/webui/cgi-bin/values/rename.js biz/webui/cgi-bin/values/add.js biz/webui/cgi-bin/values/move-to.js biz/webui/cgi-bin/values/remove.js biz/webui/cgi-bin/values/index.js biz/webui/cgi-bin/values/list.js biz/webui/cgi-bin/check-update.js biz/webui/cgi-bin/init.js biz/webui/cgi-bin/log/set.js biz/webui/cgi-bin/plugins/get-plugins.js biz/webui/cgi-bin/intercept-https-connects.js biz/webui/cgi-bin/do-not-show-again.js biz/webui/cgi-bin/server-info.js biz/webui/cgi-bin/rootca.js biz/webui/cgi-bin/hide-https-connects.js biz/webui/lib/index.js biz/webui/lib/proxy.js biz/webui/htdocs.js biz/index.js biz/init.js biz/weinre.js index.js

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 2 of 8 files from the diff.

@@ -193,31 +193,31 @@
Loading
193 193
  return (str && str[0].toUpperCase()) + str.substring(1);
194 194
}
195 195
196 -
function getHttpsAgent(options) {
196 +
function getHttpsAgent(options, reqOpts) {
197 197
  var key = getCacheKey(options);
198 198
  var agent = httpsAgents.get(key);
199 -
  var headers = options.headers || {};
200 -
  if (!agent) {
201 -
    options.proxyAuth = options.auth;
202 -
    options.rejectUnauthorized = config.rejectUnauthorized;
203 -
    var originProxyHeaders = {};
199 +
  if (reqOpts) {
200 +
    var headers = options.headers || {};
201 +
    var proxyHeaders = {};
204 202
    Object.keys(headers).forEach(function(key) {
205 203
      var rawKey = key.split('-').map(capitalize).join('-');
206 -
      originProxyHeaders[rawKey] = headers[key];
204 +
      proxyHeaders[rawKey] = headers[key];
207 205
    });
208 -
    headers = originProxyHeaders;
206 +
    reqOpts._tunnelProxyHeaders = proxyHeaders;
207 +
  }
208 +
  if (!agent) {
209 +
    options.proxyAuth = options.auth;
210 +
    options.rejectUnauthorized = config.rejectUnauthorized;
209 211
    options.proxy = {
210 212
      host: options.proxyHost,
211 -
      port: options.proxyPort,
212 -
      headers: headers
213 +
      port: options.proxyPort
213 214
    };
214 215
    var agentName = options.isHttps ? 'httpsOverHttp' : 'httpOverHttp';
215 216
    if (options.proxyServername) {
216 217
      options.proxy.servername = options.proxyServername;
217 218
      agentName += 's';
218 219
    }
219 220
    agent = new tunnel[agentName](options);
220 -
    agent.originProxyHeaders = headers;
221 221
    httpsAgents.set(key, agent);
222 222
    agent.on('free', preventThrowOutError);
223 223
    var createSocket = agent.createSocket;
@@ -227,17 +227,6 @@
Loading
227 227
        cb(socket);
228 228
      });
229 229
    };
230 -
  } else if (agent.originProxyHeaders) {
231 -
    if (headers['user-agent']) {
232 -
      agent.originProxyHeaders['User-Agent'] = headers['user-agent'];
233 -
    } else {
234 -
      delete agent.originProxyHeaders['User-Agent'];
235 -
    }
236 -
    if (headers['proxy-authorization']) {
237 -
      agent.originProxyHeaders['Proxy-Authorization'] = headers['proxy-authorization'];
238 -
    } else {
239 -
      delete agent.originProxyHeaders['Proxy-Authorization'];
240 -
    }
241 230
  }
242 231
  return agent;
243 232
}

@@ -146,7 +146,7 @@
Loading
146 146
147 147
function setProxyAgent(options, proxyOpts) {
148 148
  proxyOpts.cacheKey = options.cacheKey;
149 -
  options.agent = proxyOpts.isSocks ? config.getSocksAgent(proxyOpts) : config.getHttpsAgent(proxyOpts);
149 +
  options.agent = proxyOpts.isSocks ? config.getSocksAgent(proxyOpts) : config.getHttpsAgent(proxyOpts, options);
150 150
}
151 151
152 152
module.exports = function(req, res, next) {

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
biz 66.67%
lib +<.01% 74.89%
index.js 88.89%
Project Totals (89 files) 74.37%
Loading