mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(electron): ipfs proxy should have error status code
This commit is contained in:
@@ -23,7 +23,9 @@ proxy.on('proxyReq', function (proxyReq, req, res, options) {
|
|||||||
proxy.on('error', (e, req, res) => {
|
proxy.on('error', (e, req, res) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
// if not ended, will hang forever
|
// if not ended, will hang forever
|
||||||
res.end();
|
res.statusCode = 502;
|
||||||
|
res.setHeader('Content-Type', 'text/plain');
|
||||||
|
res.end(`502 Bad Gateway: ${e.message}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// start server
|
// start server
|
||||||
|
|||||||
Reference in New Issue
Block a user