Compress images only for NIP-96 endpoint

This commit is contained in:
2024-05-14 10:04:42 +01:00
parent 423fbfdb77
commit 8a58cfe825
4 changed files with 63 additions and 42 deletions

View File

@ -1,9 +1,7 @@
use std::collections::HashMap;
use std::sync::Mutex;
use chrono::Utc;
use rocket::{FromForm, Responder, Route, routes, State};
use rocket::data::ByteUnit;
use rocket::form::Form;
use rocket::fs::TempFile;
use rocket::serde::json::Json;
@ -161,7 +159,7 @@ async fn upload(
let mime_type = form.media_type
.unwrap_or("application/octet-stream");
match fs
.put(file, mime_type)
.put(file, mime_type, true)
.await
{
Ok(blob) => {