File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,14 @@ class JSONBridge extends BridgeAbstract {
1212 'name ' => 'JSON URL ' ,
1313 'type ' => 'text ' ,
1414 'required ' => true ,
15+ 'exampleValue ' => 'https://example.com/json/ ' ,
1516 'title ' => 'The URL returning a JSON document (array or object) ' ,
1617 ],
18+ 'cookie ' => [
19+ 'name ' => 'The complete cookie value ' ,
20+ 'title ' => 'Paste the cookie value from your browser if needed ' ,
21+ 'required ' => false ,
22+ ],
1723 'root ' => [
1824 'name ' => 'JMESPath: items selector ' ,
1925 'type ' => 'text ' ,
@@ -59,7 +65,13 @@ class JSONBridge extends BridgeAbstract {
5965 ]];
6066
6167 public function collectData () {
62- $ raw = getContents ($ this ->getInput ('url ' ));
68+ if ($ this ->getInput ('cookie ' )) {
69+ $ raw = getContents ($ this ->getInput ('url ' ), [], [CURLOPT_COOKIE => $ this ->getInput ('cookie ' )]);
70+ }
71+ else {
72+ $ raw = getContents ($ this ->getInput ('url ' ));
73+ }
74+
6375 $ json = json_decode ($ raw , true );
6476 if ($ json === null ) {
6577 returnServerError ('Invalid JSON ' );
You can’t perform that action at this time.
0 commit comments