Merge pull request #4 from CountBleck/fixes
Fix error reporting in Cyclone custom bare
This commit is contained in:
commit
68a6b18ce1
1 changed files with 5 additions and 6 deletions
|
|
@ -45,9 +45,9 @@ async function fetchBare(url, res, req) {
|
||||||
var options = {
|
var options = {
|
||||||
method: req.method,
|
method: req.method,
|
||||||
headers: {
|
headers: {
|
||||||
"Refer": url.href,
|
"Referer": url.href,
|
||||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36",
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36",
|
||||||
"cookies": req.cookies,
|
"Cookie": req.headers.cookie,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,11 +90,10 @@ async function fetchBare(url, res, req) {
|
||||||
request.body.pipe(res)
|
request.body.pipe(res)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
res.writeHead(500, 'Error', {
|
res.writeHead(500, 'Error', {
|
||||||
'content-type': 'application/javascript'
|
'content-type': 'application/javascript'
|
||||||
})
|
})
|
||||||
res.end(e);
|
res.end(e.stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue