mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
update to 4.0
This commit is contained in:
19
test/spec_rule/rule/rule_should_intercept_https_req.js
Normal file
19
test/spec_rule/rule/rule_should_intercept_https_req.js
Normal file
@@ -0,0 +1,19 @@
|
||||
//rule scheme :
|
||||
|
||||
module.exports = {
|
||||
*summary() {
|
||||
return 'Rule to intercept https request';
|
||||
},
|
||||
|
||||
*beforeSendResponse(requestDetail, responseDetail) {
|
||||
const newResponse = responseDetail.response;
|
||||
newResponse.body = newResponse.body.toString() + '_hello_world';
|
||||
return {
|
||||
response: newResponse
|
||||
};
|
||||
},
|
||||
|
||||
*beforeDealHttpsRequest(requestDetail) {
|
||||
return requestDetail.host.indexOf('localhost:3001') > -1;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user