Finally, you don't have to type https:// (or http://) in the --server
feature. By default, this corrects the URL to https, so if your lainsafe instance is running in port 80 (Tor, or something) (altough is very possible you copypasted the onion address so it contains the http:// thing). That's a TODO. I'll fix it one of these days.
This commit is contained in:
parent
706d73d151
commit
d1908fe776
2 changed files with 4 additions and 1 deletions
BIN
doc/lainsafecli.1.gz
Normal file
BIN
doc/lainsafecli.1.gz
Normal file
Binary file not shown.
|
@ -109,14 +109,17 @@ $file = $ARGV[@ARGV-1];
|
||||||
|
|
||||||
die "File does not exist\n" unless -e $file;
|
die "File does not exist\n" unless -e $file;
|
||||||
|
|
||||||
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
|
|
||||||
my $req;
|
my $req;
|
||||||
|
|
||||||
# Fake user agent
|
# Fake user agent
|
||||||
$ua->agent("Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0");
|
$ua->agent("Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0");
|
||||||
|
|
||||||
|
# modify url if necessary
|
||||||
|
substr($DEFAULT_SERVER, 0, 0, 'https://') unless $DEFAULT_SERVER =~ /^(http|https):\/\//;
|
||||||
# check if server is running lainsafe
|
# check if server is running lainsafe
|
||||||
|
|
||||||
|
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
|
||||||
if (!$ua->get($url_to_upload)->is_success) {
|
if (!$ua->get($url_to_upload)->is_success) {
|
||||||
print "$url_to_upload is not running lainsafe. (--get-response to check the error)\n";
|
print "$url_to_upload is not running lainsafe. (--get-response to check the error)\n";
|
||||||
print $ua->get($url_to_upload)->decoded_content if $get_response;
|
print $ua->get($url_to_upload)->decoded_content if $get_response;
|
||||||
|
|
Loading…
Add table
Reference in a new issue