mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update http.js fix #122
This commit is contained in:
parent
4db44324e4
commit
8b5abfe022
16
lib/http.js
16
lib/http.js
|
@ -752,8 +752,9 @@ var HTTPObject = function(engine) {
|
|||
if (typeof str === "undefined" || str == null) return '';
|
||||
|
||||
var str = String(str);
|
||||
var Lpos = str.indexOf('{');
|
||||
var Rpos = str.indexOf('}', Lpos + 1);
|
||||
var L = '{', R = '}';
|
||||
var Lpos = str.indexOf(L);
|
||||
var Rpos = str.indexOf(R, Lpos + 1);
|
||||
var s0 = '',
|
||||
s1 = [],
|
||||
s2 = null,
|
||||
|
@ -784,12 +785,17 @@ var HTTPObject = function(engine) {
|
|||
s2 = this.variables[s3];
|
||||
}
|
||||
} else {
|
||||
s2 = s3;
|
||||
// fix #122
|
||||
try {
|
||||
s2 = JSON.stringify(JSON.parse(L + s3 + R));
|
||||
} catch (e) {
|
||||
s2 = s3;
|
||||
}
|
||||
}
|
||||
}
|
||||
str = str.substring(0, Lpos) + s2 + str.substring(Rpos + 1);
|
||||
Lpos = str.indexOf('{');
|
||||
Rpos = str.indexOf('}', Lpos + 1);
|
||||
Lpos = str.indexOf(L);
|
||||
Rpos = str.indexOf(R, Lpos + 1);
|
||||
}
|
||||
|
||||
return str;
|
||||
|
|
Loading…
Reference in New Issue
Block a user