Use file asset instead of slurp

This commit is contained in:
Citlali del Rey 2023-02-06 21:14:12 -08:00
parent 3220294cbe
commit d21452c39b
Signed by: nullobsi
GPG Key ID: 933A1F44222C2634
1 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ sub upload_post($c) {
}
# TODO: streaming somehow
my $file_content = $file->slurp;
my $file_asset = $file->asset;
my $ua = $c->ua;
my $url = Mojo::URL->new($c->config->{ipfs}->{gatewayWriteUrl});
@ -211,7 +211,7 @@ sub upload_post($c) {
);
return $ua->post_p($url => form => {
file => {
content => $file_content,
content => $file_asset,
filename => $filename,
'Content-Type' => $file->headers->content_type,
},