mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-05 17:38:05 +08:00
🎨 #3516【公众号】修正代理认证请求头设置错误的问题
This commit is contained in:
parent
404102a4c8
commit
1f0dbcc2aa
@ -50,12 +50,12 @@ public class WxMpServiceOkHttpImpl extends BaseWxMpServiceImpl<OkHttpClient, OkH
|
|||||||
clientBuilder.proxy(getRequestHttpProxy().getProxy());
|
clientBuilder.proxy(getRequestHttpProxy().getProxy());
|
||||||
|
|
||||||
//设置授权
|
//设置授权
|
||||||
clientBuilder.authenticator(new Authenticator() {
|
clientBuilder.proxyAuthenticator(new Authenticator() {
|
||||||
@Override
|
@Override
|
||||||
public Request authenticate(Route route, Response response) throws IOException {
|
public Request authenticate(Route route, Response response) throws IOException {
|
||||||
String credential = Credentials.basic(httpProxy.getProxyUsername(), httpProxy.getProxyPassword());
|
String credential = Credentials.basic(httpProxy.getProxyUsername(), httpProxy.getProxyPassword());
|
||||||
return response.request().newBuilder()
|
return response.request().newBuilder()
|
||||||
.header("Authorization", credential)
|
.header("Proxy-Authorization", credential)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user