Skip to content

Commit ab5ce74

Browse files
committed
fix: Increase client json payload size limit
64k is too small. Increase to 2MB for safe ceiling
1 parent 31abaf7 commit ab5ce74

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/proxy.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,18 @@ pub async fn forward(
4646
if new_url.path().contains("containers/json") {
4747
let _list_span = span!(Level::DEBUG, "Container List").entered();
4848

49-
let containers = &res.json::<Vec<ContainerSummary>>().await.unwrap();
49+
let container_res = &res.json::<Vec<ContainerSummary>>()
50+
// 2mb in bytes
51+
.limit(2097152).await;
52+
53+
let containers = match container_res {
54+
Ok(list_res) => {
55+
list_res
56+
}
57+
Err(e) => {
58+
panic!("{e}");
59+
}
60+
};
5061

5162
// filter all containers to only those that have values from CONTAINER_NAMES includes in their names
5263
let filtered_containers = containers.into_iter()

0 commit comments

Comments
 (0)