Skip to content

Commit

Permalink
Merge pull request #25 from rederly/feature/request-new-version
Browse files Browse the repository at this point in the history
update version endpoint, fix remaining IO snags
  • Loading branch information
tommy-lettieri authored Dec 30, 2020
2 parents 7c01a1a + efa50b6 commit cf2443f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/RenderApp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ sub startup {
$r->post('/render-api/unique')->to('IO#findUniqueSeeds');

$r->any('/rendered')->to('render#problem');
$r->any('/version' => sub {shift->reply->file($staticPath.'version.txt')});
$r->any('/request' => sub {shift->requestData2JSON});

# pass all requests via ww2_files through to lib/WeBWorK/htdocs
Expand Down
9 changes: 4 additions & 5 deletions lib/RenderApp/Controller/IO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub writer {
my $source = decode_base64( $validatedInput->{problemSource} );
my $file_path = $validatedInput->{writeFilePath};

if ( $source =~ /\s*/ ) {
if ( $source =~ /^\s*$/ ) {
doBadThings( $file_path );
return $c->render( text => $file_path );
}
Expand Down Expand Up @@ -122,8 +122,6 @@ sub catalog {
push @$required,
{
field => 'basePath',
checkType => 'like',
check => $regex->{anyPg},
};
push @$optional,
{
Expand Down Expand Up @@ -409,7 +407,6 @@ sub validate {
if (exists $req->{checkType}) {
$v->required( $req->{field} )->check( $req->{checkType}, $req->{check} );
} else {
warn "skipping type check for " . $req->{field} . ".\n";
$v->required( $req->{field} );
}
}
Expand Down Expand Up @@ -448,7 +445,9 @@ sub validate {
}

sub doBadThings {
Mojo::File->new(shift)->make_path->touch;
my $path = Mojo::File->new(shift);
$path->dirname->make_path;
$path->touch;
return;
}

Expand Down
1 change: 0 additions & 1 deletion public/version

This file was deleted.

1 change: 1 addition & 0 deletions public/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.4

0 comments on commit cf2443f

Please sign in to comment.