From 7b1126cadcdeaa3e0286ae75d066a1c6845707b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Mon, 27 Jun 2022 13:30:24 +0200 Subject: [PATCH] Fix 302-quarkus-vertx-jwt start up by reordering Vert.X Web handler Two days ago Vert.X were [bumped to 4.3.1](https://github.com/quarkusio/quarkus/pull/26294) that caused errors in CI daily runs. According to the [4.3 release notes](https://vertx.io/blog/whats-new-in-vert-x-4-3/#vertx-web) the handler order matters, I also found similar issue [reported here](https://github.com/vert-x3/vertx-web/issues/2182]. Security policy handler `CorsHandler` should be registered after the logging handler. --- .../src/main/java/io/quarkus/qe/vertx/web/Application.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/Application.java b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/Application.java index dad1b99b..c97a4304 100644 --- a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/Application.java +++ b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/Application.java @@ -87,8 +87,8 @@ void onStop(@Observes ShutdownEvent ev) { private void addRoute(HttpMethod method, String path, AUTH authEnabled, Handler handler) { Route route = this.router.route(method, path) - .handler(CorsHandler.create("*")) - .handler(LoggerHandler.create()); + .handler(LoggerHandler.create()) + .handler(CorsHandler.create("*")); if (method.equals(HttpMethod.POST) || method.equals(HttpMethod.PUT)) route.handler(BodyHandler.create());