File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,25 @@ public function __construct($transaction)
1111 $ this ->transaction = $ transaction ;
1212 }
1313
14+ public function removeQueryStringFromUrl ()
15+ {
16+ $ pathParts = explode ('? ' , $ this ->transaction ->fullPath );
17+ $ this ->transaction ->fullPath = $ pathParts [0 ];
18+ }
19+
1420 public function replaceInPath ($ old , $ new )
1521 {
1622 $ this ->transaction ->request ->uri = str_replace ($ old , $ new , $ this ->transaction ->request ->uri );
1723 $ this ->transaction ->fullPath = str_replace ($ old , $ new , $ this ->transaction ->fullPath );
1824 }
1925
26+ public function alterBody (\Closure $ closure )
27+ {
28+ $ requestBody = json_decode ($ this ->transaction ->request ->body );
29+ $ requestBody = $ closure ($ requestBody );
30+ $ this ->transaction ->request ->body = json_encode ($ requestBody );
31+ }
32+
2033 /**
2134 * Sets a HTTP header
2235 * @param $header
You can’t perform that action at this time.
0 commit comments