zhengyangyong commented on a change in pull request #47: General development
dir translation and include img
URL:
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212530882
##########
File path: java-chassis-reference/en_US/general-development/http-filter.md
##########
@@ -75,23 +77,20 @@ public interface HttpServerFilter {
## 3.2 needCacheRequest
-与HttpClientFilter不同的是,增加了决定是否缓存请求的功能。
+Unlike HttpClientFilter, the ability to decide whether to cache requests is
added.
-这是因为ServiceComb不仅仅能使用standalone的方式运行,也能运行于web容器(比如tomcat),在servlet的实现上,请求码流只能读取一次,并且不一定支持reset(比如tomcat),RESTful框架需要执行反序列化,需要读取body码流,签名逻辑也需要读取body码流,如果使用默认的处理,必然有一方功能无法实现。
+This is because ServiceComb can not only run in standalone mode but also run
in web container (such as Tomcat). In the implementation of a servlet, request
stream can only be read once, and does not necessarily support reset (such as
Tomcat), RESTful The framework needs to perform deserialization. It needs to
read the body stream. The signature logic also needs to read the body stream.
If the default processing is used, one of the functions cannot be implemented.
-所以运行于web容器场景时,所有HttpServerFilter,只要有一个返回需要缓存请求,则body码流会被复制保存起来,以支持重复读取。
+So when running in a web container scenario, all HttpServerFilters, as long as
there is a return request that needs to be cached, the body stream will be
copied and saved to support repeated reads.
-入参是本次请求对应的元数据,业务可以针对该请求决定是否需要缓存请求。
+The input parameter is the metadata corresponding to the request, and the
service can decide whether the cache request is needed for the request.
## 3.3 afterReceiveRequest
-在收到请求后,根据url、header、query、码流计算签名,并与header中的签名对比,如果签名不对,直接构造一个Response作为返回值,只要不是返回NULL,则框架会中断对其他HttpClientFilter的调用。
+After receiving the request, the signature is calculated according to the URL,
header, query, and code stream, and compared with the signature in the header.
If the signature is incorrect, a Response is directly constructed as the return
value. As long as the NULL is not returned, the framework will interrupt the
other HttpClientFilter. Call.
Review comment:
怎么有一个.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services