Skip to content

Commit aca6efd

Browse files
author
Andrea Cosentino
committed
fix: settingResponse
1 parent 883a5cb commit aca6efd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/utils/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export const Utils = {
369369
buildFullUrl(req: IncomingMessage, config: ResolvedConfig): URL {
370370
const host = req.headers.host ?? (
371371
typeof config.server.host === "string"
372-
? config.server.host
372+
? config.server.host
373373
: "localhost"
374374
);
375375
return new URL(req.url!, `http${config.server.https ? 's' : ''}://${host}`);
@@ -1338,6 +1338,10 @@ export const Utils = {
13381338
if (res.writableEnded) {
13391339
return Promise.resolve(null);
13401340
}
1341+
if (res.headersSent) {
1342+
res.end();
1343+
return Promise.resolve(null);
1344+
}
13411345
res.statusCode = responseData.status;
13421346
if (responseData.isError) {
13431347
responseData.headers.forEach(({ name }) => {

0 commit comments

Comments
 (0)