File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ abstract class AbstractPlugin implements EventSubscriberInterface {
1010 // apply these methods only to those events whose request URL passes this filter
1111 protected $ url_pattern ;
1212
13+ // apply these methods only to those events whose request URL passes this filter (regex)
14+ protected $ url_pattern_regex ;
15+
1316 public function onBeforeRequest (ProxyEvent $ event ){
1417 // fired right before a request is being sent to a proxy
1518 }
@@ -36,6 +39,11 @@ final public function route(ProxyEvent $event){
3639 return ;
3740 }
3841
42+ // url filter (regex) provided and current request url does not match it
43+ if ($ this ->url_pattern_regex && !preg_match ($ this ->url_pattern_regex , $ url )){
44+ return ;
45+ }
46+
3947 switch ($ event ->getName ()){
4048
4149 case 'request.before_send ' :
@@ -66,4 +74,4 @@ final public static function getSubscribedEvents(){
6674 }
6775}
6876
69- ?>
77+ ?>
You can’t perform that action at this time.
0 commit comments