From 39f016d829cd3da71c989827ba05d437d04e1179 Mon Sep 17 00:00:00 2001 From: xujimu Date: Wed, 14 Dec 2022 12:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttp=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=97=B6=E8=BE=93=E5=85=A5=E7=A9=BA=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=A9=BA=E5=AF=86=E7=A0=81=E5=90=8E=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E5=BC=B9=E7=AA=97=E8=AE=A4=E8=AF=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/auth/BasicHttpProxyAuthenticationProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/monkeywie/proxyee/server/auth/BasicHttpProxyAuthenticationProvider.java b/src/main/java/com/github/monkeywie/proxyee/server/auth/BasicHttpProxyAuthenticationProvider.java index 539f83e..33a85bc 100644 --- a/src/main/java/com/github/monkeywie/proxyee/server/auth/BasicHttpProxyAuthenticationProvider.java +++ b/src/main/java/com/github/monkeywie/proxyee/server/auth/BasicHttpProxyAuthenticationProvider.java @@ -31,7 +31,9 @@ public BasicHttpToken authenticate(String authorization) { String token = authorization.substring(AUTH_TYPE_BASIC.length() + 1); String decode = new String(Base64.getDecoder().decode(token)); String[] arr = decode.split(":"); - usr = arr[0]; + if (arr.length >= 1) { + usr = arr[0]; + } if (arr.length >= 2) { pwd = arr[1]; }