diff --git a/doc/lainsafecli.1.gz b/doc/lainsafecli.1.gz new file mode 100644 index 0000000..0a8294c Binary files /dev/null and b/doc/lainsafecli.1.gz differ diff --git a/lainsafecli b/lainsafecli index 6b5c7a3..595ff82 100755 --- a/lainsafecli +++ b/lainsafecli @@ -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;