mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
fix #122
This commit is contained in:
parent
b2433e9057
commit
1a4931e283
15
lib/http.js
15
lib/http.js
|
@ -771,6 +771,14 @@ var HTTPObject = function(engine) {
|
|||
s2 = null,
|
||||
s3, s4;
|
||||
|
||||
// fix #122
|
||||
if (str.indexOf(L) == 0) {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
return str;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
while (Lpos > -1 && Rpos > -1) {
|
||||
s0 = str.substring(Lpos + 1, Rpos);
|
||||
s2 = '';
|
||||
|
@ -796,12 +804,7 @@ var HTTPObject = function(engine) {
|
|||
s2 = this.variables[s3];
|
||||
}
|
||||
} else {
|
||||
// fix #122
|
||||
try {
|
||||
s2 = JSON.stringify(JSON.parse(L + s3 + R));
|
||||
} catch (e) {
|
||||
s2 = s3;
|
||||
}
|
||||
s2 = s3;
|
||||
}
|
||||
}
|
||||
str = str.substring(0, Lpos) + s2 + str.substring(Rpos + 1);
|
||||
|
|
Loading…
Reference in New Issue
Block a user