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.
@@ -2340,7 +2340,11 @@ async function newHttpBatchRpcResponse(request, localMain, options) {
2340
2340
  * @param options Optional RPC session options. You can also pass headers to set on the response.
2341
2341
  */
2342
2342
  async function nodeHttpBatchRpcResponse(request, response, localMain, options) {
2343
- if (request.method !== "POST") response.writeHead(405, "This endpoint only accepts POST requests.");
2343
+ if (request.method !== "POST") {
2344
+ response.writeHead(405, "This endpoint only accepts POST requests.", options?.headers);
2345
+ response.end();
2346
+ return;
2347
+ }
2344
2348
  let body = await new Promise((resolve, reject) => {
2345
2349
  let chunks = [];
2346
2350
  request.on("data", (chunk) => {