X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2Fpr0n.pm;h=3c9161b94b1da8b117db489c8b4b6c6c89ae7736;hp=f5715f53b7077b9f7d5b30831f7915ff75aecb79;hb=3b2c7786062de33fd427f8b30556570cab9d4349;hpb=872fc70512d24ca88b368a9c58269a283c804192 diff --git a/perl/Sesse/pr0n/pr0n.pm b/perl/Sesse/pr0n/pr0n.pm index f5715f5..3c9161b 100644 --- a/perl/Sesse/pr0n/pr0n.pm +++ b/perl/Sesse/pr0n/pr0n.pm @@ -4,8 +4,9 @@ use Sesse::pr0n::Index; use Sesse::pr0n::Image; use Sesse::pr0n::Rotate; use Sesse::pr0n::Select; -use Sesse::pr0n::WebDAV; use Sesse::pr0n::NewEvent; +use Sesse::pr0n::Upload; +use Sesse::pr0n::UploadForm; use IO::File::WithPath; package Sesse::pr0n::pr0n; @@ -51,8 +52,6 @@ sub handler { $res->content_type('text/html; charset=utf-8'); $res->content(IO::File::WithPath->new($Sesse::pr0n::Config::image_base . 'files/newevent.html')); return $res; - } elsif ($uri =~ m#^/webdav#) { - return Sesse::pr0n::WebDAV::handler($r); } elsif ($uri =~ m#^/usage/([a-zA-Z0-9.-]+)$#) { my $res = Plack::Response->new(200); $res->content(IO::File::WithPath->new($Sesse::pr0n::Config::image_base . "usage/$1")); @@ -63,6 +62,10 @@ sub handler { return Sesse::pr0n::Select::handler($r); } elsif ($uri =~ m#^/newevent$#) { return Sesse::pr0n::NewEvent::handler($r); + } elsif ($uri =~ /^\/upload\// && ($r->method eq 'OPTIONS' || $r->method eq 'PUT')) { + return Sesse::pr0n::Upload::handler($r); + } elsif ($uri =~ /^\/upload\/[a-zA-Z0-9-]+\/?$/) { + return Sesse::pr0n::UploadForm::handler($r); } elsif ($uri =~ /^\/[a-zA-Z0-9-]+\/?$/ || $uri =~ /^\/\+all\/?$/) { return Sesse::pr0n::Index::handler($r);