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:
15
test/spec_rule/rule/rule_replace_request_protocol.js
Normal file
15
test/spec_rule/rule/rule_replace_request_protocol.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//rule scheme :
|
||||
module.exports = {
|
||||
*summary() {
|
||||
return 'The rule to replace request protocol';
|
||||
},
|
||||
|
||||
*beforeSendRequest(requestDetail) {
|
||||
const newConfig = {
|
||||
protocol: 'http',
|
||||
requestOptions: requestDetail.requestOptions
|
||||
};
|
||||
newConfig.requestOptions.port = 3000;
|
||||
return newConfig;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user