capnweb 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2311,7 +2311,11 @@ async function newHttpBatchRpcResponse(request, localMain, options) {
2311
2311
  * @param options Optional RPC session options. You can also pass headers to set on the response.
2312
2312
  */
2313
2313
  async function nodeHttpBatchRpcResponse(request, response, localMain, options) {
2314
- if (request.method !== "POST") response.writeHead(405, "This endpoint only accepts POST requests.");
2314
+ if (request.method !== "POST") {
2315
+ response.writeHead(405, "This endpoint only accepts POST requests.", options?.headers);
2316
+ response.end();
2317
+ return;
2318
+ }
2315
2319
  let body = await new Promise((resolve, reject) => {
2316
2320
  let chunks = [];
2317
2321
  request.on("data", (chunk) => {