Url formatting is handled by the server

This commit is contained in:
Kyle Czar 2020-08-30 13:08:36 -03:00
parent 4385c9ed1d
commit b6e32c25a5
2 changed files with 8 additions and 4 deletions

View file

@ -54,6 +54,10 @@ $string =~ s/\.//g;
my $upload_filehandle = $q->upload("file");
# onion urls will be http
my $prot = length $ENV{HTTPS} ? "https" : "http";
$filename = $string . "." . $extension;
my $allowed_extension = 1;
@ -77,10 +81,10 @@ if($allowed_extension)
{
print FILE;
}
close FILE;
print $ENV{HTTP_REFERER} . "$upload_dir$filename";
print $prot. "://" . $ENV{HTTP_HOST} . "$upload_dir$filename";
}
else

View file

@ -126,10 +126,10 @@ if ($req->{_content} =~ /instance/) # If someone knows how to do it another way,
print $req->{_content} . "\n";
exit;
}
print $DEFAULT_SERVER . "/" . $req->{_content} . "\n";
print $req->{_content} . "\n";
if ($STORE_LINKS) {
open FILE,'>>',$LINKS_FILE or die $!;
print FILE $DEFAULT_SERVER . "/" . $req->{_content} . " $file" ."\n";
print FILE $req->{_content} . " $file" ."\n";
close FILE;
}