diff --git a/proxy/src/http/sql_over_http.rs b/proxy/src/http/sql_over_http.rs index a4eb13a10b..736413c85c 100644 --- a/proxy/src/http/sql_over_http.rs +++ b/proxy/src/http/sql_over_http.rs @@ -34,7 +34,7 @@ enum Payload { Batch(Vec), } -pub const MAX_RESPONSE_SIZE: usize = 1024 * 1024; // 1 MB +pub const MAX_RESPONSE_SIZE: usize = 10 * 1024 * 1024; // 10 MB const MAX_REQUEST_SIZE: u64 = 1024 * 1024; // 1 MB static RAW_TEXT_OUTPUT: HeaderName = HeaderName::from_static("neon-raw-text-output"); @@ -214,7 +214,7 @@ pub async fn handle( if request_content_length > MAX_REQUEST_SIZE { return Err(anyhow::anyhow!( - "request is too large (max {MAX_REQUEST_SIZE} bytes)" + "request is too large (max is {MAX_REQUEST_SIZE} bytes)" )); } @@ -292,13 +292,15 @@ async fn query_to_json( // big. pin_mut!(row_stream); let mut rows: Vec = Vec::new(); - let mut curret_size = 0; + let mut current_size = 0; while let Some(row) = row_stream.next().await { let row = row?; - curret_size += row.body_len(); + current_size += row.body_len(); rows.push(row); - if curret_size > MAX_RESPONSE_SIZE { - return Err(anyhow::anyhow!("response too large")); + if current_size > MAX_RESPONSE_SIZE { + return Err(anyhow::anyhow!( + "response is too large (max is {MAX_RESPONSE_SIZE} bytes)" + )); } }