Skip to content

Commit 6de42b9

Browse files
committed
Small tweak to ReverseProxyServer
This allows the Node Client to work with it, as it sends "bearer" instead of "Bearer".
1 parent 4c63194 commit 6de42b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-app/src/main/java/com/marklogic/client/test/ReverseProxyServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ public void getConnection(ProxyTarget target, HttpServerExchange exchange, Proxy
246246
*/
247247
private void replaceFakeMarkLogicCloudHeaderIfNecessary(HttpServerExchange exchange) {
248248
final String auth = exchange.getRequestHeaders().getFirst("Authorization");
249-
final String fakeBearerIndicator = "Bearer " + FAKE_ACCESS_TOKEN_INDICATOR;
250-
if (auth != null && auth.startsWith(fakeBearerIndicator)) {
249+
final String fakeBearerIndicator = "BEARER " + FAKE_ACCESS_TOKEN_INDICATOR;
250+
if (auth != null && auth.toUpperCase().startsWith(fakeBearerIndicator)) {
251251
String basicAuthValue = auth.substring(fakeBearerIndicator.length());
252252
logger.info("Replacing fake MarkLogic Cloud Authorization header with a basic Authorization header: " + basicAuthValue);
253253
exchange.getRequestHeaders().put(Headers.AUTHORIZATION, basicAuthValue);

0 commit comments

Comments
 (0)