fix(server): apply cors before legacy auth (#26092)

This commit is contained in:
Luke Parker 2026-05-07 08:55:09 +10:00 • committed by GitHub
commit 2dffdfff4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,10 +107,10 @@ function createHono(opts: CorsOptions, selection: ServerBackend.Selection = Serv
const backendAttributes = ServerBackend.attributes(selection)
const app = new Hono()
.onError(ErrorMiddleware)
.use(AuthMiddleware)
.use(LoggerMiddleware(backendAttributes))
.use(CompressionMiddleware)
.use(CorsMiddleware(opts))
.use(LoggerMiddleware(backendAttributes))
.use(AuthMiddleware)
.use(CompressionMiddleware)
.route("/global", GlobalRoutes())
const runtime = adapter.create(app)