DenoDDeno
Powered by
abiA
Deno•3y ago•
1 reply
abi

Oak – ctx.assert with custom response headers

Am I doing this wrong? No extra custom headers are being set in the response as far as I can see in cURL:

    ctx.assert(
      !missingHeaders,
      Status.BadRequest,
      JSON.stringify({ error: `Required headers missing: ${missingHeaders}` }),
      { expose: true, headers: { "content-type": "application/json", "foo": "bar" } },
    );
    ctx.assert(
      !missingHeaders,
      Status.BadRequest,
      JSON.stringify({ error: `Required headers missing: ${missingHeaders}` }),
      { expose: true, headers: { "content-type": "application/json", "foo": "bar" } },
    );
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Oak, `ctx.assert`, and middleware
abiAabi / help
3y ago