fix: strip prefix of s3 resource (#2780)

This commit is contained in:
Guillaume Bouvignies
2023-12-05 09:52:49 +01:00
committed by GitHub
parent cb8bc75b30
commit f3a0c81639
+5 -9
View File
@@ -631,15 +631,11 @@ async fn get_workspace_s3_resource<'c>(
LargeFileStorage::S3Storage(s3_lfs) => s3_lfs,
};
return get_s3_resource(
authed,
user_db,
db,
token,
w_id,
s3_lfs.s3_resource_path.as_str(),
)
.await;
let stripped_resource_path = match s3_lfs.s3_resource_path.strip_prefix("$res:") {
Some(stripped) => stripped,
None => s3_lfs.s3_resource_path.as_str(),
};
return get_s3_resource(authed, user_db, db, token, w_id, stripped_resource_path).await;
}
async fn get_s3_resource<'c>(