Skip to content

Commit c011a2e

Browse files
author
Daniel Källstrand Modig
authored
Ignore --insecure and --compressed options (#12)
1 parent c089af4 commit c011a2e

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

src/Console/Commands/CurlCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class CurlCommand extends Command
99
{
10-
protected $signature = 'shift:curl {--X|request=} {--G|get} {--H|header=*} {--d|data=*} {--data-urlencode=*} {--F|form=*} {--digest} {--basic} {--connect-timeout=} {--max-timeout=} {--retry=} {--s|silent} {--u|user=} {--L|location} {url}';
10+
protected $signature = 'shift:curl {--X|request=} {--G|get} {--H|header=*} {--d|data=*} {--data-urlencode=*} {--F|form=*} {--digest} {--basic} {--connect-timeout=} {--max-timeout=} {--retry=} {--s|silent} {--u|user=} {--L|location} {--compressed} {--insecure} {url}';
1111

1212
protected $description = 'Convert a UNIX curl request to an HTTP Client request';
1313

@@ -39,6 +39,8 @@ private function gatherOptions()
3939
'retry' => $this->option('retry'),
4040
'silent' => $this->option('silent'),
4141
'user' => $this->option('user'),
42+
'compressed' => $this->option('compressed'),
43+
'insecure' => $this->option('insecure'),
4244
];
4345
}
4446
}

tests/Feature/Console/Commands/CurlCommandTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function curlCommandFixtures()
4242
'Entire transaction timeout' => ['max-timeout'],
4343
'Ignore location flag' => ['ignore-location-flag'],
4444
'Missing URL scheme' => ['missing-url-scheme'],
45+
'GET request with compressed flag' => ['with-compressed-option'],
46+
'GET request with insecure flag' => ['with-insecure-option'],
4547
];
4648
}
4749

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -H 'Accept: application/json' https://example.com --compressed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Http::acceptJson()
2+
->get('https://example.com');
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -H 'Accept: application/json' https://example.com --insecure
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Http::acceptJson()
2+
->get('https://example.com');

0 commit comments

Comments
 (0)