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:
qorg11 2020-10-08 13:49:19 +02:00
parent 706d73d151
commit d1908fe776
No known key found for this signature in database
GPG Key ID: 343FC20A4ACA62B9
2 changed files with 4 additions and 1 deletions

BIN
doc/lainsafecli.1.gz Normal file

Binary file not shown.

View File

@ -109,14 +109,17 @@ $file = $ARGV[@ARGV-1];
die "File does not exist\n" unless -e $file;
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
my $req;
# Fake user agent
$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
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
if (!$ua->get($url_to_upload)->is_success) {
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;