Prevent registry proxy from trying to send responses twice
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user