mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-23 11:11:27 +00:00
14 lines
345 B
JavaScript
14 lines
345 B
JavaScript
//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
|
|
}
|
|
}
|
|
}
|
|
};
|