From 237a1a340873b68b6b563437a4d8f8820e614404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=93=B2?= Date: Fri, 4 Aug 2017 14:35:39 +0800 Subject: [PATCH] =?UTF-8?q?statistics=5Freport=20=E5=85=BC=E5=AE=B9H2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在H2中,req和res的字段都是为小写,正则需要匹配大小写,否则会报错 --- src/qiniu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qiniu.js b/src/qiniu.js index 932c7184..f84eaa5a 100644 --- a/src/qiniu.js +++ b/src/qiniu.js @@ -1511,7 +1511,7 @@ // send statistics log if (!op.disable_statistics_report) { - var req_id = info.responseHeaders.match(/(X-Reqid\:\ )([\w\.\%-]*)/)[2]; + var req_id = info.responseHeaders.match(/(X-Reqid\:\ )([\w\.\%-]*)/i)[2]; var startAt = file._start_at ? file._start_at.getTime() : nowTime.getTime(); statisticsLogger.log( info.status, @@ -1823,4 +1823,4 @@ global.Qiniu = Qiniu; global.QiniuJsSDK = QiniuJsSDK; -})(window); \ No newline at end of file +})(window);