RestLocale
This commit is contained in:
@@ -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)
|
|
||||||
|| headers.containsKey(Rest.REST_HEADER_CURRUSERID)) { //外部request不能包含RPC的header信息
|
|
||||||
req.setHeaders(new HashMap<>(headers));
|
req.setHeaders(new HashMap<>(headers));
|
||||||
|
if (headers.containsKey(Rest.REST_HEADER_RPC)) { //外部request不能包含RPC的header信息
|
||||||
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();
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user