fix(servertools): Fix compression stream creation returns, handler proxy buffer conversion, and sitemap URL concatenation
This commit is contained in:
@@ -41,10 +41,11 @@ export class HandlerProxy extends Handler {
|
||||
}
|
||||
|
||||
let responseToSend: Buffer = proxiedResponse.body;
|
||||
if (typeof responseToSend !== 'string') {
|
||||
console.log(proxyRequestUrl);
|
||||
console.log(responseToSend);
|
||||
throw new Error(`Proxied response is not a string, but ${typeof responseToSend}`);
|
||||
|
||||
// Remove incorrect type check that expects responseToSend to be a string
|
||||
// Instead, ensure it's a Buffer for consistent handling
|
||||
if (!Buffer.isBuffer(responseToSend)) {
|
||||
responseToSend = Buffer.from(responseToSend.toString());
|
||||
}
|
||||
|
||||
if (optionsArg && optionsArg.responseModifier) {
|
||||
@@ -74,4 +75,4 @@ export class HandlerProxy extends Handler {
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user