es::MooseLike::Base qw( Str CodeRef ArrayRef InstanceOf );
use Carp qw( confess );
use JSON qw( from_json to_json );
use HTML::HTML5::Entities qw( encode_entities_numeric );
use constant read_only =>
$self, $req) = @_;
my $id = $self->make_paste_id;
$self->storage->file("$id.paste")->spew(
to_json( +{ %{$req->parameters} } ),
);
return Response->new(
302,
[
'Content-Type' => 'text/pla
rage->file("$id.paste");
-r $file or return $self->show_error("Bad file", 404);
my $data = from_json($file->slurp);
exists $req->parameters->{raw}
? Response->new(200, ['Content-Type' => 'text/