@@ -7,6 +7,7 @@ sub usage {
7
7
" -a Allow curl's default headers\n " ,
8
8
" -d Output man page HTML links after command line\n " ,
9
9
" -h Show short help\n " ,
10
+ " -H Output HTTP generated URLs instead\n " ,
10
11
" -i Ignore HTTP version\n " ,
11
12
" --libcurl Output libcurl code instead\n " ,
12
13
" -n Output notes after command line\n " ,
@@ -28,6 +29,7 @@ my $disableheadersnotseen = 1;
28
29
my $shellcompatible = 1; # may not been windows command prompt compat
29
30
my $uselongoptions = 1; # instead of short
30
31
my $uselibcurl = 0; # --libcurl
32
+ my $usehttp = 0;
31
33
32
34
while ($ARGV [0]) {
33
35
if (($ARGV [0] eq " -h" ) || ($ARGV [0] eq " --help" )) {
@@ -41,6 +43,10 @@ while($ARGV[0]) {
41
43
$usedocs = 1;
42
44
shift @ARGV ;
43
45
}
46
+ elsif ($ARGV [0] eq " -H" ) {
47
+ $usehttp = 1;
48
+ shift @ARGV ;
49
+ }
44
50
elsif ($ARGV [0] eq " -i" ) {
45
51
$usesamehttpversion = 0;
46
52
shift @ARGV ;
@@ -370,10 +376,10 @@ foreach my $h (sort keys %header) {
370
376
}
371
377
372
378
if ($path =~ / [ &?]/ ) {
373
- $url = sprintf " \" https ://%s%s \" " , $header {' host' }, $path ;
379
+ $url = sprintf " \" %s ://%s%s \" " , $usehttp ? " http " : " https " , $header {' host' }, $path ;
374
380
}
375
381
else {
376
- $url = sprintf " https ://%s%s " , $header {' host' }, $path ;
382
+ $url = sprintf " %s ://%s%s " , $usehttp ? " http " : " https " , $header {' host' }, $path ;
377
383
}
378
384
379
385
if ($disabledheaders || $addedheaders ) {
0 commit comments