mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-27 07:45:41 +00:00
update to 4.0
This commit is contained in:
13
test/spec_rule/rule/rule_replace_request_option.js
Normal file
13
test/spec_rule/rule/rule_replace_request_option.js
Normal file
@@ -0,0 +1,13 @@
|
||||
//rule scheme :
|
||||
module.exports = {
|
||||
|
||||
*beforeSendRequest(requestDetail) {
|
||||
const newOption = requestDetail.requestOptions;
|
||||
if (newOption.hostname === 'localhost' && newOption.path === '/test/should_replace_option') {
|
||||
newOption.path = '/test/new_replace_option';
|
||||
return {
|
||||
requestOptions: newOption
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user