Skip to content

Linear-time preflight header check, and a safer default origin in the config stub

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 09:24
Immutable release. Only release title and notes can be modified.

3.0.1 (2026-11-19)

Bug Fixes

  • match preflight request headers in linear time (8c38d96)
  • stubs: restrict CORS origins outside development (f664532)

Preflight header check

With the default headers: true, the preflight check looked up each name of Access-Control-Request-Headers in a list with indexOf, so a client could make it quadratic. A 13.7 KB header took about 10 ms of event loop time. The check now uses a Set, and the same request takes about 0.6 ms. The response does not change.

Default origin of config/cors.ts

node ace configure @adonisjs/cors now writes origin: app.inDev ? true : [], the same default as the starter kits. Every origin is allowed in development, and no origin is allowed in other environments until you list them. Before, the stub allowed every origin, with credentials, in each environment.

This changes only new config files. If your config/cors.ts has origin: true, list the origins of your production app.

Full Changelog: v3.0.0...v3.0.1