From: Steinar H. Gunderson Date: Mon, 6 Jun 2016 11:33:44 +0000 (+0200) Subject: Password-protect the upload form, so that the browser does not need to send the first... X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=388116cb107c3cae1f53a264caa324a367f01a5c;hp=400a1bbb95bf6837807e2819825cddd00c219cf1 Password-protect the upload form, so that the browser does not need to send the first image twice (first for 401, then for the actual upload). --- diff --git a/perl/Sesse/pr0n/UploadForm.pm b/perl/Sesse/pr0n/UploadForm.pm index 8eb73a7..0c3a906 100644 --- a/perl/Sesse/pr0n/UploadForm.pm +++ b/perl/Sesse/pr0n/UploadForm.pm @@ -20,6 +20,9 @@ sub handler { or return error($r, "Could not extract event"); my $event = $1; + my ($user,$takenby) = Sesse::pr0n::Common::check_access($r); + return Sesse::pr0n::Common::generate_401($r) if (!defined($user)); + my $res = Plack::Response->new(200); $res->content_type("text/html; charset=utf-8"); my $io = IO::String->new;