Merge pull request #5702 from mempool/nymkappa/fix-response-header

fix duplicated response header
This commit is contained in:
nymkappa 2024-12-23 15:38:11 +08:00 committed by GitHub
commit c66f028f12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -229,6 +229,7 @@ class BitcoinRoutes {
if (e instanceof Error && e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) { if (e instanceof Error && e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) {
statusCode = 404; statusCode = 404;
handleError(req, res, statusCode, 'No such mempool or blockchain transaction'); handleError(req, res, statusCode, 'No such mempool or blockchain transaction');
return;
} }
handleError(req, res, statusCode, 'Failed to get transaction'); handleError(req, res, statusCode, 'Failed to get transaction');
} }
@ -248,6 +249,7 @@ class BitcoinRoutes {
if (e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) { if (e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) {
statusCode = 404; statusCode = 404;
handleError(req, res, statusCode, 'No such mempool or blockchain transaction'); handleError(req, res, statusCode, 'No such mempool or blockchain transaction');
return;
} }
handleError(req, res, statusCode, 'Failed to get raw transaction'); handleError(req, res, statusCode, 'Failed to get raw transaction');
} }
@ -334,6 +336,7 @@ class BitcoinRoutes {
if (e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) { if (e instanceof Error && e.message && e.message.indexOf('No such mempool or blockchain transaction') > -1) {
statusCode = 404; statusCode = 404;
handleError(req, res, statusCode, 'No such mempool or blockchain transaction'); handleError(req, res, statusCode, 'No such mempool or blockchain transaction');
return;
} }
handleError(req, res, statusCode, 'Failed to get transaction status'); handleError(req, res, statusCode, 'Failed to get transaction status');
} }