Skip to content

Commit

Permalink
add content type
Browse files Browse the repository at this point in the history
  • Loading branch information
avoonix committed Jun 24, 2024
1 parent 00d1f71 commit 80c9c41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fuzzle/src/qdrant/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ impl<T> SensibleQdrantErrorExt<T> for anyhow::Result<T> {
.build()
.expect("static regex to compile");
if not_found_re.is_match(&error_message) {
tracing::info!("treating not found error as optional");
Ok(None)
} else {
tracing::info!("treating error as actual error");
Err(VectorDatabaseError::Other(err))
}
}
Expand Down
6 changes: 4 additions & 2 deletions fuzzle/src/web/server/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use crate::web::server::{AppState, AuthData, AuthenticatedUser};
// Ok(HttpResponse::Ok().body(buf))
// }

#[actix_web::get("/thumbnails/sticker-set/{setId}")]
#[actix_web::get("/thumbnails/sticker-set/{setId}/image.png")]
#[tracing::instrument(skip(data))]
async fn sticker_set_thumbnail(
Path(set_id): Path<String>,
Expand All @@ -80,10 +80,11 @@ async fn sticker_set_thumbnail(
.await?;
Ok(HttpResponse::Ok()
.insert_header(thumbnail_cache_control_header())
.insert_header(header::ContentType::png())
.body(buf))
}

#[actix_web::get("/thumbnails/compare-sticker-sets/{setId1}/{setId2}")]
#[actix_web::get("/thumbnails/compare-sticker-sets/{setId1}/{setId2}/image.png")]
#[tracing::instrument(skip(data))]
async fn sticker_comparison_thumbnail(
Path((set_id_a, set_id_b)): Path<(String, String)>,
Expand All @@ -102,6 +103,7 @@ async fn sticker_comparison_thumbnail(
.await?;
Ok(HttpResponse::Ok()
.insert_header(thumbnail_cache_control_header())
.insert_header(header::ContentType::png())
.body(buf))
}

Expand Down

0 comments on commit 80c9c41

Please sign in to comment.