diff --git a/cn.html b/cn.html index 9e14363..a091577 100644 --- a/cn.html +++ b/cn.html @@ -344,14 +344,14 @@ newOption.path = '/redirect/to/another/path';
return null;
var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.statusCode = 404;
return {
response: newResponse
};
- 修改返回的内容
-var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.body += '--from anyproxy--';
return {
response: newResponse
@@ -472,8 +472,8 @@ newResponse.body += '--from anyproxy--';
- 修改发送到 http://httpbin.org/post 的post数据
-anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
- sample:
+anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
+ sample:
modify the post data towards http://httpbin.org/post
test:
curl -H "Content-Type: text/plain" -X POST -d 'original post data' http://httpbin.org/post --proxy http://127.0.0.1:8001
@@ -481,6 +481,7 @@ newResponse.body += '--from anyproxy--';
{ "data": "i-am-anyproxy-modified-post-data" }
*/
module.exports = {
+ summary: 'Rule to modify request data',
*beforeSendRequest(requestDetail) {
if (requestDetail.url.indexOf('http://httpbin.org/post') === 0) {
return {
diff --git a/en.html b/en.html
index 3ee6ab7..829e544 100644
--- a/en.html
+++ b/en.html
@@ -341,14 +341,14 @@ newOption.path = '/redirect/to/another/path';
return null;
- modify the response status code
-var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.statusCode = 404;
return {
response: newResponse
};
- modify the response content
-var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.body += '--from anyproxy--';
return {
response: newResponse
@@ -468,8 +468,8 @@ newResponse.body += '--from anyproxy--';
- modify the post body of http://httpbin.org/post
-anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
- sample:
+anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
+ sample:
modify the post data towards http://httpbin.org/post
test:
curl -H "Content-Type: text/plain" -X POST -d 'original post data' http://httpbin.org/post --proxy http://127.0.0.1:8001
@@ -477,6 +477,7 @@ newResponse.body += '--from anyproxy--';
{ "data": "i-am-anyproxy-modified-post-data" }
*/
module.exports = {
+ summary: 'Rule to modify request data',
*beforeSendRequest(requestDetail) {
if (requestDetail.url.indexOf('http://httpbin.org/post') === 0) {
return {
diff --git a/index.html b/index.html
index 3ee6ab7..829e544 100644
--- a/index.html
+++ b/index.html
@@ -341,14 +341,14 @@ newOption.path = '/redirect/to/another/path';
return null;
- modify the response status code
-var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.statusCode = 404;
return {
response: newResponse
};
- modify the response content
-var newResponse = Object.assign({}, responseDetail.reponse);
+var newResponse = Object.assign({}, responseDetail.response);
newResponse.body += '--from anyproxy--';
return {
response: newResponse
@@ -468,8 +468,8 @@ newResponse.body += '--from anyproxy--';
- modify the post body of http://httpbin.org/post
-anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
- sample:
+anyproxy --rule https://raw.githubusercontent.com/alibaba/anyproxy/4.x/rule_sample/sample_modify_request_data.js
/*
+ sample:
modify the post data towards http://httpbin.org/post
test:
curl -H "Content-Type: text/plain" -X POST -d 'original post data' http://httpbin.org/post --proxy http://127.0.0.1:8001
@@ -477,6 +477,7 @@ newResponse.body += '--from anyproxy--';
{ "data": "i-am-anyproxy-modified-post-data" }
*/
module.exports = {
+ summary: 'Rule to modify request data',
*beforeSendRequest(requestDetail) {
if (requestDetail.url.indexOf('http://httpbin.org/post') === 0) {
return {