Fix resizing on custom routes

This commit is contained in:
Harrison Burt 2022-03-30 23:00:00 +01:00
parent 0b3d0965ff
commit 9201f389d4
2 changed files with 8 additions and 3 deletions

View File

@ -190,7 +190,12 @@ impl BucketController {
desired_kind
};
let maybe_existing = self.caching_fetch(image_id, fetch_kind, sizing_id).await?;
let maybe_existing = self.caching_fetch(
image_id,
fetch_kind,
if self.config.mode == ProcessingMode::Realtime { 0 } else { sizing_id },
).await?;
let (data, retrieved_kind) = match maybe_existing {
// If we're in JIT mode we want to re-encode the image and store it.
None => if self.config.mode == ProcessingMode::Jit {

View File

@ -97,7 +97,7 @@ async fn test_basic_aot_upload_retrieval_without_guessing() -> anyhow::Result<()
.get("image_id")
.string();
let res = app.get(format!("/v1/user-profiles/{}", file_id))
let res = app.get(format!("/v1/images/user-profiles/{}", file_id))
.send()
.await;
@ -130,7 +130,7 @@ async fn test_basic_aot_upload_retrieval_with_guessing() -> anyhow::Result<()> {
.get("image_id")
.string();
let res = app.get(format!("/v1/user-profiles/{}", file_id))
let res = app.get(format!("/v1/images/user-profiles/{}", file_id))
.send()
.await;