1
0
mirror of synced 2026-02-12 15:17:51 +08:00

修复HTTP代理认证头设置错误:将authenticator改为proxyAuthenticator,将Authorization改为Proxy-Authorization

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-28 14:04:18 +00:00
parent 3dbc37471e
commit 8b22e438eb
5 changed files with 10 additions and 10 deletions

View File

@@ -80,11 +80,11 @@ public class WxQidianServiceOkHttpImpl extends BaseWxQidianServiceImpl<OkHttpCli
clientBuilder.proxy(getRequestHttpProxy().getProxy());
// 设置授权
clientBuilder.authenticator(new Authenticator() {
clientBuilder.proxyAuthenticator(new Authenticator() {
@Override
public Request authenticate(Route route, Response response) throws IOException {
String credential = Credentials.basic(httpProxy.getProxyUsername(), httpProxy.getProxyPassword());
return response.request().newBuilder().header("Authorization", credential).build();
return response.request().newBuilder().header("Proxy-Authorization", credential).build();
}
});
httpClient = clientBuilder.build();