Prevent registry proxy from trying to send responses twice

This commit is contained in:
nicktrn
2024-07-26 08:44:03 +01:00
parent e64cd5ee86
commit e27d5cd861
@@ -281,6 +281,11 @@ export class RegistryProxy {
proxyReq.on("error", (error) => {
logger.error("Error proxying request", { error: error.message });
if (response.headersSent) {
return;
}
response.writeHead(500, { "Content-Type": "text/plain" });
response.end(`Internal Server Error: ${error.message}`);
});