File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,6 @@ 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-
1613 public function onBeforeRequest (ProxyEvent $ event ){
1714 // fired right before a request is being sent to a proxy
1815 }
@@ -35,13 +32,16 @@ final public function route(ProxyEvent $event){
3532 $ url = $ event ['request ' ]->getUri ();
3633
3734 // url filter provided and current request url does not match it
38- if ($ this ->url_pattern && strpos ($ url , $ this ->url_pattern ) === false ){
39- return ;
40- }
41-
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 ;
35+ if ($ this ->url_pattern ){
36+ if (strpos ($ this ->url_pattern , '/ ' ) === 0 ){
37+ if (!preg_match ($ this ->url_pattern , $ url ))
38+ return ;
39+ }
40+ else
41+ {
42+ if (stripos ($ url , $ this ->url_pattern ) === false )
43+ return ;
44+ }
4545 }
4646
4747 switch ($ event ->getName ()){
You can’t perform that action at this time.
0 commit comments