window7下karma 报 The header content contains invalid characters BUG
2021-04-22 08:26
标签:array app tchar 中国 打开 nec contains connect err 打开你的依赖 将里面的setHeader方法改成下面这样,干掉序列化日期时出现的中文 出处:https://www.cnblogs.com/rubylouvre/p/6127190.html?utm_source=tuicool&utm_medium=referral window7下karma 报 The header content contains invalid characters BUG 标签:array app tchar 中国 打开 nec contains connect err 原文地址:http://www.cnblogs.com/1rookie/p/8022217.htmlnode_modules\karma\node_modules\connect\lib\patch.js
res.setHeader = function(field, val){
var key = field.toLowerCase()
, prev;
// special-case Set-Cookie
if (key === ‘set-cookie‘) {
// detect code doing getHeader -> setHeader
if (Array.isArray(val) && val.length > 1) {
prev = [].concat(this.getHeader(field) || []);
val = unique(prev, val);
}
return this.appendHeader(field, val);
}
// charset
if (‘content-type‘ == key && this.charset) {
val = utils.setCharset(val, this.charset, true);
}
try{
if(typeof val === ‘string‘){
val = val.replace(/中国标准时间/,‘‘)
}
return setHeader.call(this, field, val);
}catch(e){
console.log(e, val,field)
}
};
文章标题:window7下karma 报 The header content contains invalid characters BUG
文章链接:http://soscw.com/index.php/essay/77989.html