Pretty web #2

Merged
alpha6 merged 3 commits from pretty_web into master 2017-08-01 15:34:39 +03:00
Showing only changes of commit 3bb9ef5b55 - Show all commits

View file

@ -145,6 +145,7 @@ get '/' => sub {
} => 'index';
# Upload image file
# There is no restriction for file size in app because restriction is present in nginx configuration
post '/upload' => ( authenticated => 1 ) => sub {
my $self = shift;
@ -163,17 +164,6 @@ post '/upload' => ( authenticated => 1 ) => sub {
);
}
# Upload max size
#my $upload_max_size = 3 * 1024 * 1024;
# Over max size
#if ($image->size > $upload_max_size) {
# return $self->render(
# template => 'error',
# message => "Upload fail. Image size is too large."
# );
#}
# Check file type
my $image_type = $image->headers->content_type;
my %valid_types = map { $_ => 1 } qw(image/gif image/jpeg image/png);