http status 에러코드 정상처리
This commit is contained in:
+34
-1
@@ -164,6 +164,9 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
||||
|
||||
//Outbound 요청에 대한 응답 메시지의 복호화 여부 결정위해 jwhong
|
||||
encryptResponseApply = StringUtils.equalsIgnoreCase(prop.getProperty("ENCRYPT_RESPONSE_APPLY", "N"), "Y");
|
||||
|
||||
//업체 300응답시 특정 http status code 경우 에러 아닌걸로 처리. 광주은행
|
||||
String errIgnore = prop.getProperty("ERROR_IGNORE_CODE", "");
|
||||
|
||||
/**
|
||||
* @formatter:off
|
||||
@@ -496,7 +499,10 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
||||
map.put(HttpAdapterServiceKey.OUTBOUND_RESPONSE_MESSAGE, responseString);
|
||||
map.put(HttpAdapterServiceKey.OUTBOUND_RESPONSE_STATUS, status);
|
||||
|
||||
if (status >= 200 && status <= 207) {
|
||||
|
||||
if (isStatusInIgnore(status,errIgnore )) {
|
||||
// 이경우 정상임
|
||||
} else if (status >= 200 && status <= 207) {
|
||||
if (useAdapterToken && StringUtils.equals(tokenErrorHttpStatusCode, "200")) {
|
||||
needReissue = checkTokenRetry(responseMessage, tokenErrorCodeKey, tokenErrorCodeValues,
|
||||
vo.getEncode());
|
||||
@@ -1563,4 +1569,31 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
||||
logger.debug("HttpClientAdapterServiceRest] after concatenate url=[" + targetUrl + "] ");
|
||||
return targetUrl;
|
||||
}
|
||||
|
||||
|
||||
private boolean isStatusInIgnore(int status, String errIgnore) {
|
||||
if (errIgnore == null || errIgnore.isEmpty()) return false;
|
||||
|
||||
String[] tokens = errIgnore.split(",");
|
||||
for (String token : tokens) {
|
||||
token = token.trim();
|
||||
if (token.contains("-")) {
|
||||
// 범위 처리
|
||||
String[] range = token.split("-");
|
||||
int start = Integer.parseInt(range[0].trim());
|
||||
int end = Integer.parseInt(range[1].trim());
|
||||
if (status >= start && status <= end) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// 단일 숫자 처리
|
||||
int code = Integer.parseInt(token);
|
||||
if (status == code) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user