Merge pull request 'Url formatting is handled by the server' (#1) from czar/lainsafe:feature into master
Reviewed-on: https://git.kalli.st/qorg11/lainsafe/pulls/1
This commit is contained in:
commit
82061f08fb
2 changed files with 8 additions and 4 deletions
|
@ -54,6 +54,10 @@ $string =~ s/\.//g;
|
||||||
|
|
||||||
my $upload_filehandle = $q->upload("file");
|
my $upload_filehandle = $q->upload("file");
|
||||||
|
|
||||||
|
# onion urls will be http
|
||||||
|
my $prot = length $ENV{HTTPS} ? "https" : "http";
|
||||||
|
|
||||||
|
|
||||||
$filename = $string . "." . $extension;
|
$filename = $string . "." . $extension;
|
||||||
my $allowed_extension = 1;
|
my $allowed_extension = 1;
|
||||||
|
|
||||||
|
@ -77,10 +81,10 @@ if($allowed_extension)
|
||||||
{
|
{
|
||||||
print FILE;
|
print FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
close FILE;
|
close FILE;
|
||||||
|
|
||||||
print $ENV{HTTP_REFERER} . "$upload_dir$filename";
|
print $prot. "://" . $ENV{HTTP_HOST} . "$upload_dir$filename";
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -126,10 +126,10 @@ if ($req->{_content} =~ /instance/) # If someone knows how to do it another way,
|
||||||
print $req->{_content} . "\n";
|
print $req->{_content} . "\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
print $DEFAULT_SERVER . "/" . $req->{_content} . "\n";
|
print $req->{_content} . "\n";
|
||||||
|
|
||||||
if ($STORE_LINKS) {
|
if ($STORE_LINKS) {
|
||||||
open FILE,'>>',$LINKS_FILE or die $!;
|
open FILE,'>>',$LINKS_FILE or die $!;
|
||||||
print FILE $DEFAULT_SERVER . "/" . $req->{_content} . " $file" ."\n";
|
print FILE $req->{_content} . " $file" ."\n";
|
||||||
close FILE;
|
close FILE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue