fix: use content_type in nip96 request as mime

closes https://github.com/v0l/route96/issues/2
This commit is contained in:
kieran 2024-11-26 13:21:06 +00:00
parent 90eadf890a
commit 641cccaadc
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -180,7 +180,7 @@ async fn upload(
Ok(f) => f, Ok(f) => f,
Err(e) => return Nip96Response::error(&format!("Could not open file: {}", e)), Err(e) => return Nip96Response::error(&format!("Could not open file: {}", e)),
}; };
let mime_type = form.media_type.unwrap_or("application/octet-stream"); let content_type = form.content_type.unwrap_or("application/octet-stream");
if form.expiration.is_some() { if form.expiration.is_some() {
return Nip96Response::error("Expiration not supported"); return Nip96Response::error("Expiration not supported");
@ -200,7 +200,7 @@ async fn upload(
} }
} }
match fs match fs
.put(file, mime_type, !form.no_transform.unwrap_or(false)) .put(file, content_type, !form.no_transform.unwrap_or(false))
.await .await
{ {
Ok(mut blob) => { Ok(mut blob) => {