File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -972,3 +972,8 @@ pub static ALLOW_STORAGE_GET_VIA_DOCUMENT_ID: LazyLock<bool> =
972972/// See https://docs.rs/tower-http/0.5.0/tower_http/timeout/struct.TimeoutLayer.html
973973pub static HTTP_SERVER_TIMEOUT_DURATION : LazyLock < Duration > =
974974 LazyLock :: new ( || Duration :: from_secs ( env_config ( "HTTP_SERVER_TIMEOUT_SECONDS" , 300 ) ) ) ;
975+
976+ /// The limit on the request size to /push_config.
977+ // Schema and code bundle pushes must be less than this.
978+ pub static MAX_PUSH_BYTES : LazyLock < usize > =
979+ LazyLock :: new ( || env_config ( "MAX_PUSH_BYTES" , 100_000_000 ) ) ;
Original file line number Diff line number Diff line change @@ -88,8 +88,6 @@ pub mod subs;
8888mod test_helpers;
8989
9090pub const MAX_CONCURRENT_REQUESTS : usize = 128 ;
91- // Schema and code bundle pushes must be less than this in 100MB
92- pub const MAX_PUSH_BYTES : usize = 100_000_000 ;
9391
9492pub struct LocalAppState {
9593 // Origin for the server (e.g. http://127.0.0.1:3210, https://demo.convex.cloud)
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use common::{
1818 knobs:: {
1919 MAX_BACKEND_ACTION_CALLBACKS_REQUEST_SIZE ,
2020 MAX_BACKEND_PUBLIC_API_REQUEST_SIZE ,
21+ MAX_PUSH_BYTES ,
2122 } ,
2223} ;
2324use http:: {
@@ -109,7 +110,6 @@ use crate::{
109110 sync_client_version_url,
110111 } ,
111112 LocalAppState ,
112- MAX_PUSH_BYTES ,
113113} ;
114114
115115pub async fn router ( st : LocalAppState ) -> Router {
@@ -142,7 +142,7 @@ pub async fn router(st: LocalAppState) -> Router {
142142 StatusCode :: INTERNAL_SERVER_ERROR
143143 } ) )
144144 . layer ( RequestDecompressionLayer :: new ( ) )
145- . layer ( DefaultBodyLimit :: max ( MAX_PUSH_BYTES ) ) ,
145+ . layer ( DefaultBodyLimit :: max ( * MAX_PUSH_BYTES ) ) ,
146146 )
147147 . route ( "/get_config" , post ( get_config) )
148148 . route ( "/get_config_hashes" , post ( get_config_hashes) )
You can’t perform that action at this time.
0 commit comments