RestLocale

This commit is contained in:
redkale
2023-09-01 08:26:48 +08:00
parent 651be0c50d
commit 95499542a4
2 changed files with 6 additions and 6 deletions

View File

@@ -112,6 +112,7 @@ public class HttpRequest extends Request<HttpContext> {
protected Supplier<Serializable> currentUserSupplier; protected Supplier<Serializable> currentUserSupplier;
//参数是否从body中取
protected boolean frombody; protected boolean frombody;
protected ConvertType reqConvertType; protected ConvertType reqConvertType;
@@ -242,13 +243,12 @@ public class HttpRequest extends Request<HttpContext> {
HttpSimpleRequest req = new HttpSimpleRequest(); HttpSimpleRequest req = new HttpSimpleRequest();
req.setBody(array.length() == 0 ? null : array.getBytes()); req.setBody(array.length() == 0 ? null : array.getBytes());
if (!getHeaders().isEmpty()) { if (!getHeaders().isEmpty()) {
if (headers.containsKey(Rest.REST_HEADER_RPC) req.setHeaders(new HashMap<>(headers));
|| headers.containsKey(Rest.REST_HEADER_CURRUSERID)) { //外部request不能包含RPC的header信息 if (headers.containsKey(Rest.REST_HEADER_RPC)) { //外部request不能包含RPC的header信息
req.setHeaders(new HashMap<>(headers));
req.removeHeader(Rest.REST_HEADER_RPC); req.removeHeader(Rest.REST_HEADER_RPC);
}
if (headers.containsKey(Rest.REST_HEADER_CURRUSERID)) { //外部request不能包含RPC的header信息
req.removeHeader(Rest.REST_HEADER_CURRUSERID); req.removeHeader(Rest.REST_HEADER_CURRUSERID);
} else {
req.setHeaders(headers);
} }
} }
parseBody(); parseBody();

View File

@@ -9,7 +9,7 @@ import static java.lang.annotation.ElementType.*;
/** /**
* 只能注解于Service类的方法的String参数或参数内的String字段 * 只能注解于Service类的方法的String参数或参数内的String字段
* <p> * <p>
* 用于获取HTTP请求端的IP地址 HttpRequest.getLocale * 用于获取HTTP请求端的Locale国际化 HttpRequest.getLocale
* *
* <p> * <p>
* 详情见: https://redkale.org * 详情见: https://redkale.org