njs: change responseBody to responseText

Because of the deprecation of responseBody

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
This commit is contained in:
Miao Wang 2023-10-07 21:00:09 +08:00
parent bdf2e73e71
commit fdb23012c4
No known key found for this signature in database
GPG Key ID: B031E3CA7BFED96E
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function fancyIndexRender(r, templateUrl){
if(rTmpl.status != 200){
return r.return(rTmpl.status);
}
var tmpl = rTmpl.responseBody;
var tmpl = rTmpl.responseText;
var result = Mark.up(tmpl, {
url: r.variables.request_uri.replace(/\/+/g, '/').replace(/\?.*$/, ''),
open: '{{',

View File

@ -24,7 +24,7 @@ function legacyIndexRender(r){
if(rTmpl.status != 200){
return r.return(rTmpl.status);
}
var tmpl = rTmpl.responseBody;
var tmpl = rTmpl.responseText;
r.subrequest('/static/njs/options.json', {
args: '',
@ -36,7 +36,7 @@ function legacyIndexRender(r){
}
var global_options;
try{
global_options = JSON.parse(rOpt.responseBody);
global_options = JSON.parse(rOpt.responseText);
}catch(e){
return r.return(500);
}
@ -58,7 +58,7 @@ function legacyIndexRender(r){
var mirs = unlisted;
if(rMirs.status == 200){
try{
mirs = mirs.concat(JSON.parse(rMirs.responseBody));
mirs = mirs.concat(JSON.parse(rMirs.responseText));
}catch(e){
}
}