Bug fixes.

This commit is contained in:
NobyDa 2024-02-26 18:10:47 +08:00
parent bff207400d
commit 7771161f05
No known key found for this signature in database
GPG Key ID: E6B0AC788D373C5B
1 changed files with 3 additions and 2 deletions

View File

@ -61,11 +61,11 @@ runs()
status: 200,
headers: {
'Content-Type': 'application/json'
},
body: '{}'
}
},
...rsp
};
ret.body = ret.body || '{}';
ret.headers = formatHeaders(ret.headers); //compatible with HTTP/2
ret.status = $.env.isQX ? `HTTP/1.1 ${ret.status}` : ret.status;
delete ret.headers['content-length'];
@ -136,6 +136,7 @@ function formatHeaders(h) {
function ChangeHeaders(id) {
const re = JSON.parse(JSON.stringify(req)); //easy deep copy
re.timeout = 30;
re.insecure = true;
if (id) {
$.log(`Request header replaced, using "${id}"`);
re.headers[k1] = list[id][k1];