From f2cafd45839342a19b5ff1a7ca26006bb855edb6 Mon Sep 17 00:00:00 2001 From: FujiHaruka Date: Mon, 11 Oct 2021 16:47:25 +0900 Subject: [PATCH] Skip adding authorization header if it already exists --- .../java/com/browserup/bup/filters/AutoBasicAuthFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browserup-proxy-core/src/main/java/com/browserup/bup/filters/AutoBasicAuthFilter.java b/browserup-proxy-core/src/main/java/com/browserup/bup/filters/AutoBasicAuthFilter.java index e2ba5f015..d3c382ce0 100644 --- a/browserup-proxy-core/src/main/java/com/browserup/bup/filters/AutoBasicAuthFilter.java +++ b/browserup-proxy-core/src/main/java/com/browserup/bup/filters/AutoBasicAuthFilter.java @@ -55,7 +55,7 @@ public HttpResponse clientToProxyRequest(HttpObject httpObject) { } } - if (base64CredentialsForHostname != null) { + if (!httpRequest.headers().contains(HttpHeaderNames.AUTHORIZATION) && base64CredentialsForHostname != null) { httpRequest.headers().add(HttpHeaderNames.AUTHORIZATION, "Basic " + base64CredentialsForHostname); } }