From d615d8057be3a83094327144c59dde5e1e1d7ad0 Mon Sep 17 00:00:00 2001 From: Martin Glass Date: Tue, 12 Dec 2023 13:50:31 -0700 Subject: [PATCH] Do not add blank Bearer token --- .../generator/providers/BearerAuthenticationProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java index 462446af..d2145482 100644 --- a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java +++ b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java @@ -34,8 +34,10 @@ public void filter(ClientRequestContext requestContext) throws IOException { } else { bearerToken = getBearerToken(); } - requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, - AuthUtils.authTokenOrBearer(this.scheme, bearerToken)); + if (!bearerToken.isBlank()) { + requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, + AuthUtils.authTokenOrBearer(this.scheme, bearerToken)); + } } private String getBearerToken() {