未验证 提交 443ad67c 编写于 作者: X Xin,Zhang 提交者: GitHub

fix headers may be null value at some situation (#96)

上级 5bf02d35
......@@ -96,7 +96,7 @@ module.exports = function(httpModule, instrumentation, contextManager) {
let contextCarrier = new ContextCarrier();
let span = contextManager.createExitSpan(options.path, options.host + ":" + options.port, contextCarrier);
contextCarrier.pushBy(function(key, value) {
if (!options.hasOwnProperty("headers")) {
if (!options.hasOwnProperty("headers") || !options.headers) {
options.headers = {};
}
options.headers[key] = value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册