Skip to content

Commit b04b8d9

Browse files
常量可读性优化
1 parent 67f1f02 commit b04b8d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/wechat/pay/contrib/apache/httpclient/SignatureExec.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
import org.apache.http.impl.execchain.ClientExecChain;
1919

2020
/**
21-
* @author bruse
21+
* @author xy-peng
2222
*/
2323
public class SignatureExec implements ClientExecChain {
2424

25+
private static final String WECHAT_PAY_HOST_NAME_SUFFIX = ".mch.weixin.qq.com";
2526
private final ClientExecChain mainExec;
2627
private final Credentials credentials;
2728
private final Validator validator;
@@ -51,7 +52,7 @@ protected void convertToRepeatableRequestEntity(HttpRequestWrapper request) thro
5152
@Override
5253
public CloseableHttpResponse execute(HttpRoute route, HttpRequestWrapper request, HttpClientContext context,
5354
HttpExecutionAware execAware) throws IOException, HttpException {
54-
if (request.getTarget().getHostName().endsWith(".mch.weixin.qq.com")) {
55+
if (request.getTarget().getHostName().endsWith(WECHAT_PAY_HOST_NAME_SUFFIX)) {
5556
return executeWithSignature(route, request, context, execAware);
5657
} else {
5758
return mainExec.execute(route, request, context, execAware);

0 commit comments

Comments
 (0)